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.$k}
- {if $smarty.get.products_only==1}
- {section loop=$params_count name=co}
- <div class="cart-item">
- <div class="cart-item-image-wrap">
- <div class="cart-item-image{if !$product.image_filename} no-image{/if}">
- {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:120}
- {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:120}
- {if $product.image_filename}
- <a href="{get_seo_url mode="product" alias=$product.alias}" style="background-image: url({s3_img width=$cart_image_width height=$cart_image_height src=$product.image_filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=$cart_image_width height=$cart_image_height src=$product.image_filename method=$shop2.my.s3_img_method}" alt="{$product.name}" title="{$product.name}" />
- </a>
- {/if}
- </div>
- </div>
- <div class="cart-item-details">
- <div class="cart-item-name">
- <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>
- {$product.name}
- </a>
- </div>
- <div class="cart-item-details__price">
- {if $product.price_old}
- <div class="price-old">
- <span>
- <strong>{$product.price_old}</strong> {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}{$currency.currency_shortname}{/if}
- </span>
- </div>
- {/if}
- {if $product.price}
- <div class="price-current">
- <strong>{$product.price}</strong> {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}{$currency.currency_shortname}{/if}{if $shop2.my.show_product_unit && $product.params.unit}/{$product.params.unit}{/if}
- </div>
- {/if}
- </div>
- <div class="cart-item-details__bottom">
- <div class="cart-amount">
- {if $gift}
- <div class="cart-price-preorder">{$e.amount}</div>
- {else}
- <div class="cart-amount-title">{#SHOP2_AMOUNT#}:</div>
- <div class="shop2-product-amount">
- <button type="button" class="shop2-btn amount-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 data-max="{$max}" data-kind="{$product.kind_id}" name="{if $e.params}amounts[{$k}][{$smarty.section.co.index}][amount]{else}amounts[{$k}]{/if}" type="text" maxlength="4" value="{if $e.params[co].amount}{$e.params[co].amount}{else}{$e.amount}{/if}" />
- <button type="button" class="shop2-btn amount-plus">+</button>
- </div>
- {/if}
- </div>
- <div class="cart-delete">
- {strip}
- <a title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$k}" data-id="
- {if $e.params}
- {ldelim}'{$k}':{ldelim}
- {foreach from=$e.params[co] 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}
- {$k}
- {/if}">
- {$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}
- </a>
- {/strip}
- </div>
- </div>
- </div>
- </div>
- {/section}
- {else}
- {section loop=$params_count name=co}
- <div class="cart-item">
- <div class="cart-item__top">
- <div class="cart-item-image-wrap">
- <div class="cart-item-image{if !$product.image_filename} no-image{/if}">
- {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:120}
- {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:120}
- {if $product.image_filename}
- <a href="{get_seo_url mode="product" alias=$product.alias}" style="background-image: url({s3_img width=$cart_image_width height=$cart_image_height src=$product.image_filename method=$shop2.my.s3_img_method});">
- <img src="{s3_img width=$cart_image_width height=$cart_image_height src=$product.image_filename method=$shop2.my.s3_img_method}" alt="{$product.name}" />
- </a>
- {/if}
- </div>
- </div>
- <div class="cart-item-details">
- {if $gift}
- <div class="cart-item-action"><strong>{#SHOP2_GIFT#}</strong></div>
- {/if}
- {assign var="stock_status" value=$product.stock_status}
- {if $stock_status == 'not_enough'}
- <div class="cart-item-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-item__action">
- <strong>{#SHOP2_PRODUCT_DELETED#}</strong>
- <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_DELETED_TOOLTIP#|htmlspecialchars}"></div>
- </div>
- {/if}
- {/if}
- <div class="cart-item-name">
- <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>
- {$product.name}
- </a>
- </div>
- {if !$shop2.my.hide_vendor_name && $product.vendor_name!=""}
- <div class="cart-item-vendor">
- <a href="{get_seo_url uri_prefix=$shop2.uri mode="vendor" alias=$product.vendor_alias}">{$product.vendor_name}</a>
- </div>
- {/if}
- {include file="global:shop2.v2-product-article.tpl"}
- {if $e.discounts_applied|@count}
- <div class="cart-item-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}
- {/foreach}
- </div>
- {/if}
- {if $product.meta|@count>0}
- <div class="cart-params">
- {if $shop2.my.gr_cart_show_options_text!=""}
- <div class="cart-params__btn">
- <span data-text="{$shop2.my.gr_cart_show_options_text}">{$shop2.my.gr_cart_show_options_text}</span>
- </div>
- {/if}
- <div class="cart-params__body">
- <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:90}
- {assign var="cart_other_image_height" value=$shop2.my.cart_other_image_height|default:90}
- <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.2.110-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[co] 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.2.110-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.2.110-color-ext.tpl" location="cart" op=$parts[1]}
- </div>
- {else}
- <div class="cart-params__title">{$o_v}</div>
- {/if}
- <input name="amounts[{$k}][{$smarty.section.co.index}][{$o_k}]" type="hidden" value="{$o_v|htmlspecialchars}" />
- {/if}
- </li>
- {/if}
- {/foreach}
- </ul>
- </div>
- </div>
- {/if}
- </div>
- </div>
- <div class="cart-item__bottom">
- {if $fix_discount}
- <div class="cart-price">
- {if $e.is_pre_order}
- <div class="cart-price-preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
- {else}
- {if $product.price_old}
- <div class="cart-price-old">{$product.price_old}</div>
- {/if}
- {$e.price|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {/if}
- </div>
- {else}
- <div class="cart-price">
- {if $e.is_pre_order}
- <div class="cart-price-preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
- {else}
- {if $product.price_old}
- <div class="cart-price-old">{$product.price_old}</div>
- {/if}
- {$e.price|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble">₽</span>{else}<span>{$currency.currency_shortname}</span>{/if}
- {/if}
- </div>
- {/if}
- <div class="cart-amount">
- {if $gift}
- <div class="cart-price-preorder">{$e.amount}</div>
- {else}
- <div class="shop2-product-amount">
- <button type="button" class="shop2-btn amount-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 data-max="{$max}" data-kind="{$product.kind_id}" name="{if $e.params}amounts[{$k}][{$smarty.section.co.index}][amount]{else}amounts[{$k}]{/if}" type="text" maxlength="4" value="{if $e.params[co].amount}{$e.params[co].amount}{else}{$e.amount}{/if}" />
- <button type="button" class="shop2-btn amount-plus">+</button>
- </div>
- {/if}
- </div>
- {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[co].amount}
- {$e.custom_params[co].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[co].amount}
- {$e.params[co].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 title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$k}" data-id="
- {if $e.params}
- {ldelim}'{$k}':{ldelim}
- {foreach from=$e.params[co] 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}
- {$k}
- {/if}">
- {$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}
- </a>
- {/strip}
- </div>
- {/if}
- </div>
- </div>
- {/section}
- {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement