Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {assign var=params_count value=1}
- {if $e.params|@count}
- {assign var=params_count value=$e.params|@count}
- {/if}
- {if isset($products[$e.kind_id])}
- {assign var="product" value=$products[$e.kind_id]}
- {else}
- {assign var="product" value=$products[$k]}
- {/if}
- {section loop=$params_count name=co}
- {if $site.reg.shop2.cf_margin_price_enabled && isset($e.position)}
- {assign var=pos value=$e.position[$k]} {*позиция*}
- {assign var=key value=$k} {*уникальный ключ итема*}
- {else}
- {assign var=pos value=$smarty.section.co.index} {*позиция*}
- {assign var=key value=$smarty.section.co.index} {*ключ итема*}
- {/if}
- <div class="cart-products__item">
- <div class="cart-products__left">
- <div class="cart-product">
- <div class="cart-product__left">
- {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:240}
- {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:240}
- <div class="gr-product-image{if !$product.image_filename} no-image{/if}{if $shop2.my.gr_images_size}{if $site.gr_shop_images.images_size=="2"} gr_image_3x4{elseif $site.gr_shop_images.images_size=="3"} gr_image_2x3{elseif $site.gr_shop_images.images_size=="4"} gr_image_4x3{elseif $site.gr_shop_images.images_size=="5"} gr_image_3x2{else} gr_image_1x1{/if}{/if}">
- <a href="{get_seo_url mode="product" alias=$product.alias}">
- {if $product.image_filename}
- <img src="{s3_img width=$cart_image_width height=$cart_image_height src=$product.image_filename method=$shop2.my.s3_img_method}"{if $site.gr_shop_images.images_view} class="gr_image_contain"{/if} alt="{$product.name}" />
- {/if}
- </a>
- </div>
- </div>
- <div class="cart-product__right">
- <div class="cart-details">
- <div class="gr-product-name">
- <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>{$product.name}</a>
- </div>
- {include file="global:shop2.2.131-product-article.tpl"}
- {*if $gift}
- <div class="cart-product-action"><strong>{#SHOP2_GIFT#}</strong></div>
- {/if*}
- {assign var="stock_status" value=$product.stock_status}
- {if $stock_status == 'not_enough'}
- <div class="cart-product-action">
- <strong>{#SHOP2_PRODUCT_NOT_ENOUGH#|sprintf:$product.amount|htmlspecialchars}</strong>
- <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_NOT_ENOUGH_TOOLTIP#|sprintf:$product.amount|htmlspecialchars}"></div>
- </div>
- {elseif $stock_status == 'deleted'}
- {if !$gift}
- <div class="cart-product-action">
- <strong>{#SHOP2_PRODUCT_DELETED#}</strong>
- <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_DELETED_TOOLTIP#|htmlspecialchars}"></div>
- </div>
- {/if}
- {/if}
- {if $e.discounts_applied|@count}
- <div class="cart-product-action">
- <strong>{#SHOP2_ACTIONS#}:</strong>
- {foreach from=$e.discounts_applied item=discount name=product_discounts}
- {$discounts.$discount.discount_name}{if !$smarty.foreach.product_discounts.last}, {/if}
- {if $cart.all.$key.promo && $discounts.$discount.discount_kind == 8}
- <span class="discount-promo">({if $cart.all.$key.promo.main}{#SHOP2_PROMO_MAIN_TITLE#}{else}{#SHOP2_PROMO_TITLE#}{/if})</span>
- {/if}
- {/foreach}
- </div>
- {/if}
- {if $cart.bonusParams.enabled && $cart.bonusParams.is_accrual && $product.bonus_value > 0 && !$cart.bonusParams.accrual_mode && !$gift}
- {if $e.params[$key].amount}
- {assign var=bonus_total_value value=$e.params[$key].amount*$product.bonus_value}
- {else}
- {assign var=bonus_total_value value=$e.amount*$product.bonus_value}
- {/if}
- <div class="bonus-param">
- <span class="bonus-param__title">
- <i class="gr-mask-icon"> </i>{#SHOP2_PRODUCT_BONUS#}<span>:</span>
- </span>
- <span class="bonus-param__value">{$bonus_total_value}</span>
- </div>
- {/if}
- </div>
- <div class="cart-params">
- {if $shop2.my.gr_cart_options_more_btn!=""}
- {if $product.meta|@count>0 || $e.params[$key]|@count > 0 || $product.vendor_name !=''}
- <div class="cart-params__more">
- <div class="{$shop2.my.gr_params_more_btn_class|default:'product-more-btn'} cart-params__more-btn" data-text="{$shop2.my.gr_cart_options_more_btn}">
- <span>
- <ins>
- {$shop2.my.gr_cart_options_more_btn}
- </ins>
- <i class="gr-mask-icon"> </i>{*icon_shop_options_down*}
- </span>
- </div>
- </div>
- {/if}
- {/if}
- <div class="cart-params__body">
- <ul class="cart-params__list">
- {if $product.vendor_name !=''}
- <li class="gr_vendor_name">
- <div class="cart-params__item">
- <div class="cart-params__title">{$shop2.my.vendor_alias|default:#SHOP2_VENDOR#}</div>
- <div class="cart-params__value">
- <a href="{get_seo_url uri_prefix=$shop2.uri mode="vendor" alias=$product.vendor_alias}">{$product.vendor_name}</a>
- </div>
- </div>
- </li>
- {/if}
- {foreach from=$product.meta item=op key=kop}
- {if $op}
- {assign var="option" value=$custom_fields.$kop}
- {if $option.in_cart || !isset($option.in_cart)} {* проверка *}
- {if $option.type == 'text' || $option.type == 'int' || $option.type == 'float' || $option.type == 'textarea' || $option.type == 'html'}
- <li class="gr_type_text">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{$op} {$option.unit|default:""}</div>
- </div>
- </li>
- {elseif $option.type == 'checkbox'}
- <li class="gr_type_checkbox">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{if $op == 1}{#SHOP2_YES#}{else}{#SHOP2_NO#}{/if}</div>
- </div>
- </li>
- {elseif $option.type == 'color'}
- <li class="gr_type_color">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- <ul class="shop2-color-pick">
- <li class="active-color"><span style="background-color: {$op};"> </span></li>
- </ul>
- </div>
- </div>
- </li>
- {elseif $option.type == 'select'}
- <li class="gr_type_select">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{$option.options.$op}</div>
- </div>
- </li>
- {elseif $option.type == 'multiselect' && !$product.cf.$kop.not_mod}
- <li class="gr_type_multiselect">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- {foreach from=$op item=o_v key=o_k name=foo}
- {$option.options.$o_v}{if !$smarty.foreach.foo.last}, {/if}
- {/foreach}
- </div>
- </div>
- </li>
- {elseif $option.type == 'image2'}
- <li class="gr_type_image2">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value gr_cart_param_img">
- <a href="{$IMAGES_DIR}{$op.filename}">
- {assign var="cart_other_image_width" value=$shop2.my.cart_other_image_width|default:225}
- {assign var="cart_other_image_height" value=$shop2.my.cart_other_image_height|default:225}
- <img src="{s3_img width=$cart_other_image_width height=$cart_other_image_height src=$op.filename method=$shop2.my.s3_img_method}" />
- </a>
- </div>
- </div>
- </li>
- {elseif $option.type == 'file2'}
- <li class="gr_type_file2">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- <a href="{$FILES_DIR}{$op.filename}" class="{$shop2.my.gr_file|default:'gr-btn gr-btn-3 gr-btn-sm gr_btn_i_r_2'} file">
- <span>
- {#SHOP2_DOWNLOAD#}
- <i class="gr-mask-icon"> </i>{*icon_shop_file*}
- </span>
- </a>
- </div>
- </div>
- </li>
- {elseif ($option.type == 'color_ref' || $option.type == 'color2') && !$product.cf.$kop.not_mod}
- <li class="gr_type_color_ref">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- {include file="global:shop2.2.131-color-ext.tpl" location="cart"}
- </div>
- </div>
- </li>
- {elseif $option.type == 'coordinates'}
- {if $op.x}
- <li class="gr_type_coordinates">
- <div class="cart-params__item">
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- <a href="#" class="shop2-map-link" data-map="{$op|@json_encode|htmlspecialchars}" data-map-type="{$option.map_type|htmlspecialchars}">{$op.title|default:$product.name|htmlspecialchars}</a>
- </div>
- </div>
- </li>
- {/if}
- {/if}
- {/if}
- {/if}
- {/foreach}
- {foreach from=$e.params[$key] item=o_v key=o_k}
- {if $o_k!='amount' && $o_v}
- {assign var="option" value=$custom_fields.$o_k}
- {assign var="parts" value=": "|explode:$o_v}
- {if $option.in_cart || !isset($option.in_cart)} {* проверка *}
- <li class="gr-field-style">
- <div class="cart-params__item">
- {*доп. поля с выбором при заказе*}
- {if $product.cf.$o_k.not_mod}
- {include file="global:shop2.2.131-product-options-not-mod.tpl"}
- {else}
- {if $parts|@count == 2 && $option.type == 'color_ref' && $product.cf.$o_k.not_mod}
- <div class="cart-params__title">{$parts[0]}: </div>
- <div class="cart-params__value">
- {include file="global:shop2.2.131-color-ext.tpl" location="cart" op=$parts[1]}
- </div>
- {else}
- <div class="cart-params__title">{$o_v}</div>
- {/if}
- <input name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" type="hidden" value="{$o_v|htmlspecialchars}" />
- {/if}
- </div>
- </li>
- {/if}
- {/if}
- {/foreach}
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="cart-products__right">
- <div class="cart-price">
- {if $e.is_pre_order}
- <div class="cart-price__preorder">
- {$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}
- </div>
- {elseif $shop2.price_on_request && $e.price == 0}
- <div class="cart-price__preorder">
- {$shop2.text_price_on_request|default:#SHOP2_PRICE_ON_REQUEST#|l}
- </div>
- {else}
- <div class="cart-price__current">
- <ins>{$e.price|price_convert}</ins> <span>{$currency.currency_shortname}</span>
- </div>
- {/if}
- </div>
- <div class="cart-amount{if $gift} cart-amount--gift{/if}">
- {if $gift}
- {*<div class="cart-amount__gift-amount">{$e.amount}</div>*}
- {else}
- {assign var="amount_min" value=$product.params.amount_min}
- {if $product.params.amount_min !="" || $product.params.amount_multiplicity !=""}
- {assign var="multiplicity" value=$product.params.amount_multiplicity|default:1}
- {/if}
- {if !$amount_min}{if $multiplicity}{assign var=amount_min value=$multiplicity}{else}{assign var="amount_min" value=$shop2.my.amount_default|default:1}{/if}{/if}
- <div class="cart-product-amount">
- <div class="shop2-product-amount gr_cart_amount">
- <button type="button" class="amount-minus">
- <i class="gr-mask-icon"> </i>
- </button>
- {assign var="max" value=$product.amount}
- {if ($shop2.product_amount_required == 0 && $product.pre_order == 0) || $product.pre_order == 4}
- {assign var="max" value=0}
- {/if}
- <input {*if $shop2.product_amount_required=='1' || $product.buy_mode==1 || $shop2.product_amount_required=='5' || $product.buy_mode==5*}data-max="{$max}"{*/if*} data-kind="{$product.kind_id}" name="{if $e.params}amounts[{$e.kind_id}][{$pos}][amount]{else}amounts[{$e.kind_id}]{/if}" type="text" maxlength="4" value="{if $e.params[$key].amount}{$e.params[$key].amount}{else}{$e.amount}{/if}" data-min="{$amount_min}" data-multiplicity="{$multiplicity}" />
- <button type="button" class="amount-plus">
- <i class="gr-mask-icon"> </i>
- </button>
- </div>
- {if $multiplicity > 0}
- <div class="amount-min">
- {#FILTER_INT_FROM#|mb_strtolower} {$amount_min} {$product.params.unit}
- {#FILTER_BY#|mb_strtolower} {if $multiplicity}{$multiplicity}{else}1{/if} {$product.params.unit}
- </div>
- {/if}
- </div>
- {/if}
- </div>
- {if $gift}
- <div class="cart-sum">
- <div class="cart-sum--gift">{if $e.amount>1}{$e.amount} {/if}{#SHOP2_AS_A_GIFT#}</div>
- </div>
- {else}
- <div class="cart-sum">
- {if $e.is_pre_order}
- <div class="cart-price__preorder">
- {$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}
- </div>
- {elseif $shop2.price_on_request && $e.price == 0}
- <div class="cart-price__preorder">
- {$shop2.text_price_on_request|default:#SHOP2_PRICE_ON_REQUEST#|l}
- </div>
- {else}
- {if $e.custom_params[$key].amount}
- {assign var="total_sum" value=$e.custom_params[$key].total}
- {else}
- {if count($discounts) > 0}
- {assign var="total_sum" value=$e.discount_sum}
- {else}
- {assign var="total_sum" value=$e.sum}
- {/if}
- {/if}
- <div class="cart-sum__price">
- {$total_sum|price_convert} <span>{$currency.currency_shortname}</span>
- </div>
- {assign var=current_old_price value=$e.price}
- {if $e.params[$key].amount}
- {assign var=current_amount value=$e.params[$key].amount}
- {else}
- {assign var=current_amount value=$e.amount}
- {/if}
- {assign var=total_old_price value=`$current_old_price*$current_amount`}
- {if !$e.is_pre_order && ($total_old_price > $total_sum)}
- <div class="cart-sum__old-price">
- Цена без скидок {$total_old_price|price_convert} {$currency.currency_shortname}
- </div>
- {/if}
- {*if !$e.is_pre_order}
- {assign var=formattedPrice value=$e.price}
- {if $e.params[$key].amount}
- {assign var=formattedAmount value=$e.params[$key].amount}
- {else}
- {assign var=formattedAmount value=$e.amount}
- {/if}
- {assign var=cart_sum_discount value=`$formattedPrice*$formattedAmount`}
- <div class="cart-sum__old-price">
- {$cart_sum_discount|price_convert} {$currency.currency_shortname}
- </div>
- {/if*}
- {/if}
- </div>
- <div class="cart-delete">
- {strip}
- <a class="cart-delete-btn" title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$e.kind_id}" data-id="
- {if $e.params}
- {ldelim}'{$e.kind_id}':{ldelim}
- {foreach from=$e.params[$key] item=o_v key=o_k name=foo}
- {if $o_k == 'amount'}
- 'amount': '0'
- {else}
- '{$o_k|htmlspecialchars}':'{$o_v|htmlspecialchars}'
- {/if}
- {if !$smarty.foreach.foo.last}, {/if}
- {/foreach}
- {rdelim}{rdelim}
- {else}
- {$e.kind_id}
- {/if}">
- <span>{$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}</span>
- <i class="gr-mask-icon"> </i>
- </a>
- {/strip}
- </div>
- {/if}
- </div>
- </div>
- {/section}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement