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}
- {assign var="product" value=$products[$e.kind_id]}
- {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-item">
- <div class="cart-item__left">
- <div class="cart-item__images">
- <div class="cart-item__image{if !$product.image_filename} no-image{/if} active">
- {if $product.image_filename}
- <a href="{$IMAGES_DIR}{$product.image_filename}" style="background-image: url({s3_img width=200 height=200 src=$product.image_filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=200 height=200 src=$product.image_filename method=$shop2.my.s3_img_method}" alt="" />
- </a>
- {/if}
- </div>
- {assign var=product_thumbs_counter value=0}
- {if !empty($product.params.images)}
- {foreach from=$product.params.images item=img key=qqq}
- {if $product_thumbs_counter<1}
- <div class="cart-item__image">
- <a href="{$IMAGES_DIR}{$img.filename}" style="background-image: url({s3_img width=200 height=200 src=$img.filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=200 height=200 src=$img.filename method=$shop2.my.s3_img_method}" alt="{$product.name|htmlspecialchars}" title="{$product.name|htmlspecialchars}" />
- </a>
- </div>
- {/if}
- {assign var=product_thumbs_counter value=$product_thumbs_counter+1}
- {/foreach}
- {/if}
- </div>
- </div>
- <div class="cart-item__right">
- <div class="cart-item__details">
- <div class="cart-item__details-left">
- {include file="global:shop2.v2-rating.tpl"}
- <div class="cart-item__name">
- <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if} class="g-user_text_color">
- {$product.name}
- </a>
- </div>
- {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 !empty($product.params.images)}
- <div class="cart-item-images">
- <div class="cart-item-images__item active">
- {if $product.image_filename}
- <a href="{$IMAGES_DIR}{$product.image_filename}" style="background-image: url({s3_img width=50 height=50 src=$product.image_filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=50 height=50 src=$product.image_filename method=$shop2.my.s3_img_method}" alt="" />
- </a>
- {/if}
- </div>
- {assign var=product_thumbs_counter2 value=0}
- {foreach from=$product.params.images item=img}
- {if $product_thumbs_counter2<1}
- <div class="cart-item-images__item">
- <a href="{$IMAGES_DIR}{$img.filename}" style="background-image: url({s3_img width=50 height=50 src=$img.filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=50 height=50 src=$img.filename method=$shop2.my.s3_img_method}" alt="{$product.name|htmlspecialchars}" title="{$product.name|htmlspecialchars}" />
- </a>
- </div>
- {assign var=product_thumbs_counter2 value=$product_thumbs_counter2+1}
- {/if}
- {/foreach}
- </div>
- {/if}
- {if !empty($product.meta) || $product.article}
- <div class="cart-item__params-btn">
- <span>{#SHOP2_PRODUCT_PARAMETRS#}</span>
- </div>
- {/if}
- </div>
- <div class="cart-item__details-right">
- {if $fix_discount}
- <div class="cart-price">
- <div class="cart-price__body">
- {if $e.is_pre_order}
- <div class="cart_preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
- {else}
- {if $e.sum!=$e.price}
- {if $e.price_old>0}
- <div class="cart-price__old">{$e.price_old}</div>
- {/if}
- {if $e.price_discounted}
- {$e.price_discounted|price_convert}
- {else}
- {$e.price|price_convert}
- {/if}
- {/if}
- {/if}
- </div>
- </div>
- {else}
- <div class="cart-price">
- <div class="cart-price__body">
- {if $e.is_pre_order}
- <div class="cart_preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
- {else}
- {if $e.sum!=$e.price}
- {if $e.price_old>0}
- <div class="cart-price__old">{$e.price_old}</div>
- {/if}
- {if $e.price_discounted}
- {$e.price_discounted|price_convert}
- {else}
- {$e.price|price_convert}
- {/if}
- {/if}
- {/if}
- </div>
- </div>
- {/if}
- <svg class="item-price-multiply" xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="-2 -2 26 26">
- <path fill="#333" fill-rule="evenodd" d="M10.482 11.604L6.77 15.316a.75.75 0 0 1-1.061-1.06l3.712-3.713-3.799-3.799a.75.75 0 0 1 1.06-1.06l3.8 3.799 3.712-3.713a.75.75 0 1 1 1.061 1.061l-3.712 3.712 3.712 3.713a.75.75 0 0 1-1.06 1.06z"></path>
- </svg>
- <div class="cart-amount">
- {if $gift}
- <div class="cart_preorder">{$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="shop2-product-amount">
- <button type="button" class="shop2-btn amount-minus g-user_wb_mount_minus"></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 class="g-form-control-text g-form-control-value item-count" {if $shop2.product_amount_required=='1' || $product.buy_mode==1}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="shop2-btn amount-plus g-user_wb_amount_plus"></button>
- </div>
- {/if}
- </div>
- <svg class="item-price-equal" xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 -1 26 26">
- <path d="M6.377 16.25a.75.75 0 1 1 0-1.5H18.5a.75.75 0 1 1 0 1.5zm0-5a.75.75 0 1 1 0-1.5H18.5a.75.75 0 1 1 0 1.5z"></path>
- </svg>
- {if $gift}
- <div class="cart-sum">0</div>
- {else}
- <div class="cart-sum">
- {if $e.is_pre_order}
- -
- {else}
- {if $fix_discount}
- {if $e.custom_params[$key].amount}
- {$e.custom_params[$key].total|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {else}
- {if count($discounts) > 0}
- {$e.discount_sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {else}
- {$e.sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {/if}
- {/if}
- {else}
- {if $e.params[$key].amount}
- {$e.params[$key].amount*$e.price|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {else}
- {if count($discounts) > 0}
- {$e.discount_sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {else}
- {$e.sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {/if}
- {/if}
- {/if}
- {/if}
- </div>
- <div class="cart-delete">
- {strip}
- <a class="gr-icon-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}">
- {$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}
- </a>
- {/strip}
- </div>
- {/if}
- </div>
- </div>
- </div>
- {if !empty($product.meta) || $product.article}
- <div class="cart-params">
- <div class="cart-item__params-btn mobile_btn">
- <span>{#SHOP2_PRODUCT_PARAMETRS#}</span>
- </div>
- <div class="cart-params__body">
- {if $product.article}
- {include file="global:shop2.v2-product-article.tpl"}
- {/if}
- <ul class="cart-params__list">
- {foreach from=$product.meta item=op key=kop}
- {if $op}
- {assign var="option" value=$custom_fields.$kop}
- {if $option.type == 'text' || $option.type == 'int' || $option.type == 'float' || $option.type == 'textarea' || $option.type == 'html'}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{$op} {$option.unit|default:""}</div>
- </li>
- {elseif $option.type == 'checkbox'}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{if $op == 1}{#SHOP2_YES#}{else}{#SHOP2_NO#}{/if}</div>
- </li>
- {elseif $option.type == 'color'}
- <li>
- <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>
- </li>
- {elseif $option.type == 'select'}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">{$option.options.$op}</div>
- </li>
- {elseif $option.type == 'multiselect' && !$option.not_mod}
- <li>
- <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>
- </li>
- {elseif $option.type == 'image2'}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value param_img">
- <a href="{$IMAGES_DIR}{$op.filename}">
- {assign var="cart_other_image_width" value=$shop2.my.cart_other_image_width|default:40}
- {assign var="cart_other_image_height" value=$shop2.my.cart_other_image_height|default:40}
- <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>
- </li>
- {elseif $option.type == 'file2'}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- <a href="{$FILES_DIR}{$op.filename}"><span class="icon"></span> {#SHOP2_DOWNLOAD#}</a>
- </div>
- </li>
- {elseif ($option.type == 'color_ref' || $option.type == 'color2') && !$option.not_mod}
- <li>
- <div class="cart-params__title">{$option.name}:</div>
- <div class="cart-params__value">
- {include file="global:shop2.v2-color-ext.tpl" location="cart"}
- </div>
- </li>
- {elseif $option.type == 'coordinates'}
- {if $op.x}
- <li>
- <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>
- </li>
- {/if}
- {/if}
- {/if}
- {/foreach}
- {foreach from=$e.params[$key] item=o_v key=o_k}
- {if $o_k!='amount' && $o_v}
- <li class="gr-field-style">
- {assign var="option" value=$custom_fields.$o_k}
- {assign var="parts" value=": "|explode:$o_v}
- {*доп. поля с выбором при заказе*}
- {if $product.cf.$o_k.not_mod}
- {include file="global:shop2.v2-product-options-not-mod.tpl"}
- {else}
- {if $parts|@count == 2 && $option.type == 'color_ref' && $option.not_mod}
- <div class="cart-params__title">{$parts[0]}: </div>
- <div class="cart-params__value">
- {include file="global:shop2.v2-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}
- </li>
- {/if}
- {/foreach}
- </ul>
- </div>
- </div>
- {/if}
- </div>
- {/section}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement