Advertisement
valeraplusplus

old_shop2.2.110-furniture-online-store-cart-product.tpl

Aug 2nd, 2022
980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 15.14 KB | None | 0 0
  1. {assign var=params_count value=1}
  2. {if $e.params|@count}
  3.     {assign var=params_count value=$e.params|@count}
  4. {/if}
  5. {assign var="product" value=$products.$k}
  6. {if $smarty.get.products_only==1}
  7.     {section loop=$params_count name=co}
  8.         <div class="cart-item">
  9.             <div class="cart-item-image-wrap">
  10.                 <div class="cart-item-image{if !$product.image_filename} no-image{/if}">
  11.                     {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:120}
  12.                     {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:120}
  13.                     {if $product.image_filename}
  14.                         <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});">
  15.                             <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}" />
  16.                         </a>
  17.                     {/if}
  18.                 </div>
  19.             </div>
  20.             <div class="cart-item-details">
  21.                    
  22.                     <div class="cart-item-name">
  23.                         <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>
  24.                             {$product.name}
  25.                         </a>
  26.                     </div>
  27.                    
  28.                     <div class="cart-item-details__price">
  29.                         {if $product.price_old}
  30.                             <div class="price-old">
  31.                                 <span>
  32.                                     <strong>{$product.price_old}</strong> {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}{$currency.currency_shortname}{/if}
  33.                                 </span>
  34.                             </div>
  35.                         {/if}
  36.                         {if $product.price}
  37.                             <div class="price-current">
  38.                                 <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}
  39.                             </div>
  40.                         {/if}
  41.                     </div>
  42.                    
  43.                     <div class="cart-item-details__bottom">
  44.                    
  45.                         <div class="cart-amount">
  46.                             {if $gift}
  47.                                 <div class="cart-price-preorder">{$e.amount}</div>
  48.                             {else}
  49.                                 <div class="cart-amount-title">{#SHOP2_AMOUNT#}:</div>
  50.                                 <div class="shop2-product-amount">
  51.                                     <button type="button" class="shop2-btn amount-minus">&#8722;</button>
  52.                                         {assign var="max" value=$product.amount}
  53.                                         {if ($shop2.product_amount_required == 0 && $product.pre_order == 0) || $product.pre_order == 4}
  54.                                             {assign var="max" value=0}
  55.                                         {/if}
  56.                                         <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}" />
  57.                                     <button type="button" class="shop2-btn amount-plus">&#43;</button>
  58.                                 </div>
  59.                             {/if}
  60.                         </div>
  61.                        
  62.                         <div class="cart-delete">
  63.                             {strip}
  64.                             <a title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$k}" data-id="
  65.                                 {if $e.params}
  66.                                     {ldelim}'{$k}':{ldelim}
  67.                                         {foreach from=$e.params[co] item=o_v key=o_k name=foo}
  68.                                             {if $o_k == 'amount'}
  69.                                                 'amount': '0'
  70.                                             {else}
  71.                                                 '{$o_k|htmlspecialchars}':'{$o_v|htmlspecialchars}'
  72.                                             {/if}
  73.                                             {if !$smarty.foreach.foo.last}, {/if}
  74.                                         {/foreach}
  75.                                     {rdelim}{rdelim}
  76.                                 {else}
  77.                                     {$k}
  78.                                 {/if}">
  79.                                 {$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}
  80.                             </a>
  81.                             {/strip}
  82.                         </div>
  83.                    
  84.                     </div>
  85.                    
  86.                 </div>
  87.         </div>
  88.     {/section}
  89. {else}
  90.     {section loop=$params_count name=co}
  91.         <div class="cart-item">
  92.             <div class="cart-item__top">
  93.                 <div class="cart-item-image-wrap">
  94.                     <div class="cart-item-image{if !$product.image_filename} no-image{/if}">
  95.                         {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:120}
  96.                         {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:120}
  97.                         {if $product.image_filename}
  98.                             <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});">
  99.                                 <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}" />
  100.                             </a>
  101.                         {/if}
  102.                     </div>
  103.                 </div>
  104.                 <div class="cart-item-details">
  105.    
  106.                     {if $gift}
  107.                         <div class="cart-item-action"><strong>{#SHOP2_GIFT#}</strong></div>
  108.                     {/if}
  109.    
  110.                     {assign var="stock_status" value=$product.stock_status}
  111.    
  112.                     {if $stock_status == 'not_enough'}
  113.                         <div class="cart-item-action">
  114.                             <strong>{#SHOP2_PRODUCT_NOT_ENOUGH#|sprintf:$product.amount|htmlspecialchars}</strong>
  115.                             <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_NOT_ENOUGH_TOOLTIP#|sprintf:$product.amount|htmlspecialchars}"></div>
  116.                         </div>
  117.                     {elseif $stock_status == 'deleted'}
  118.                         {if !$gift}
  119.                             <div class="cart-item__action">
  120.                                 <strong>{#SHOP2_PRODUCT_DELETED#}</strong>
  121.                                 <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_DELETED_TOOLTIP#|htmlspecialchars}"></div>
  122.                             </div>
  123.                         {/if}
  124.                     {/if}
  125.    
  126.    
  127.                     <div class="cart-item-name">
  128.                         <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>
  129.                             {$product.name}
  130.                         </a>
  131.                     </div>
  132.    
  133.                     {if !$shop2.my.hide_vendor_name && $product.vendor_name!=""}
  134.                         <div class="cart-item-vendor">
  135.                             <a href="{get_seo_url uri_prefix=$shop2.uri mode="vendor" alias=$product.vendor_alias}">{$product.vendor_name}</a>
  136.                         </div>
  137.                     {/if}
  138.    
  139.                     {include file="global:shop2.v2-product-article.tpl"}
  140.                    
  141.    
  142.                     {if $e.discounts_applied|@count}
  143.                         <div class="cart-item-action"><strong>{#SHOP2_ACTIONS#}:</strong>
  144.                             {foreach from=$e.discounts_applied item=discount name=product_discounts}
  145.                                 {$discounts.$discount.discount_name}{if !$smarty.foreach.product_discounts.last}, {/if}
  146.                             {/foreach}
  147.                         </div>
  148.                     {/if}
  149.                     {if $product.meta|@count>0}
  150.                         <div class="cart-params">
  151.                             {if $shop2.my.gr_cart_show_options_text!=""}
  152.                                 <div class="cart-params__btn">
  153.                                     <span data-text="{$shop2.my.gr_cart_show_options_text}">{$shop2.my.gr_cart_show_options_text}</span>
  154.                                 </div>
  155.                             {/if}
  156.                             <div class="cart-params__body">
  157.                                 <ul class="cart-params__list">
  158.                                     {foreach from=$product.meta item=op key=kop}
  159.                                         {if $op}
  160.                                             {assign var="option" value=$custom_fields.$kop}
  161.    
  162.                                             {if $option.type == 'text' || $option.type == 'int' || $option.type == 'float' || $option.type == 'textarea' || $option.type == 'html'}
  163.                                                 <li>
  164.                                                     <div class="cart-params__title">{$option.name}:</div>
  165.                                                     <div class="cart-params__value">{$op} {$option.unit|default:""}</div>
  166.                                                 </li>
  167.                                             {elseif $option.type == 'checkbox'}
  168.                                                 <li>
  169.                                                     <div class="cart-params__title">{$option.name}:</div>
  170.                                                     <div class="cart-params__value">{if $op == 1}{#SHOP2_YES#}{else}{#SHOP2_NO#}{/if}</div>
  171.                                                 </li>
  172.                                             {elseif $option.type == 'color'}
  173.                                                 <li>
  174.                                                     <div class="cart-params__title">{$option.name}:</div>
  175.                                                     <div class="cart-params__value">
  176.                                                         <ul class="shop2-color-pick">
  177.                                                             <li class="active-color"><span style="background-color: {$op};">&nbsp;</span></li>
  178.                                                         </ul>
  179.                                                     </div>
  180.                                                 </li>
  181.                                             {elseif $option.type == 'select'}
  182.                                                 <li>
  183.                                                     <div class="cart-params__title">{$option.name}:</div>
  184.                                                     <div class="cart-params__value">{$option.options.$op}</div>
  185.                                                 </li>
  186.                                             {elseif $option.type == 'multiselect' && !$option.not_mod}
  187.                                                 <li>
  188.                                                     <div class="cart-params__title">{$option.name}:</div>
  189.                                                     <div class="cart-params__value">
  190.                                                         {foreach from=$op item=o_v  key=o_k name=foo}
  191.                                                             {$option.options.$o_v}{if !$smarty.foreach.foo.last}, {/if}
  192.                                                         {/foreach}
  193.                                                     </div>
  194.                                                 </li>
  195.                                             {elseif $option.type == 'image2'}
  196.                                                 <li>
  197.                                                     <div class="cart-params__title">{$option.name}:</div>
  198.                                                     <div class="cart-params__value param_img">
  199.                                                         <a href="{$IMAGES_DIR}{$op.filename}">
  200.                                                             {assign var="cart_other_image_width" value=$shop2.my.cart_other_image_width|default:90}
  201.                                                             {assign var="cart_other_image_height" value=$shop2.my.cart_other_image_height|default:90}
  202.                                                             <img src="{s3_img width=$cart_other_image_width height=$cart_other_image_height src=$op.filename method=$shop2.my.s3_img_method}" />
  203.                                                         </a>
  204.                                                     </div>
  205.                                                 </li>
  206.                                             {elseif $option.type == 'file2'}
  207.                                                 <li>
  208.                                                     <div class="cart-params__title">{$option.name}:</div>
  209.                                                     <div class="cart-params__value">
  210.                                                         <a href="{$FILES_DIR}{$op.filename}"><span class="icon"></span> {#SHOP2_DOWNLOAD#}</a>
  211.                                                     </div>
  212.                                                 </li>
  213.                                             {elseif ($option.type == 'color_ref' || $option.type == 'color2') && !$option.not_mod}
  214.                                                 <li>
  215.                                                     <div class="cart-params__title">{$option.name}:</div>
  216.                                                     <div class="cart-params__value">
  217.                                                         {include file="global:shop2.2.110-color-ext.tpl" location="cart"}
  218.                                                     </div>
  219.                                                 </li>
  220.                                             {elseif $option.type == 'coordinates'}
  221.                                                 {if $op.x}
  222.                                                     <li>
  223.                                                         <div class="cart-params__title">{$option.name}:</div>
  224.                                                         <div class="cart-params__value">
  225.                                                             <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>
  226.                                                         </div>
  227.                                                     </li>
  228.                                                 {/if}
  229.                                             {/if}
  230.                                         {/if}
  231.                                     {/foreach}
  232.    
  233.                                     {foreach from=$e.params[co] item=o_v key=o_k}
  234.                                         {if $o_k!='amount' && $o_v}
  235.                                         <li class="gr-field-style">
  236.                                             {assign var="option" value=$custom_fields.$o_k}
  237.                                             {assign var="parts" value=": "|explode:$o_v}
  238.                                             {*доп. поля с выбором при заказе*}
  239.                                             {if $product.cf.$o_k.not_mod}
  240.                                                 {include file="global:shop2.2.110-product-options-not-mod.tpl"}
  241.                                             {else}
  242.                                                 {if $parts|@count == 2 && $option.type == 'color_ref' && $option.not_mod}
  243.                                                     <div class="cart-params__title">{$parts[0]}: </div>
  244.                                                     <div class="cart-params__value">
  245.                                                         {include file="global:shop2.2.110-color-ext.tpl" location="cart" op=$parts[1]}
  246.                                                     </div>
  247.                                                 {else}
  248.                                                     <div class="cart-params__title">{$o_v}</div>
  249.                                                 {/if}
  250.                                                 <input name="amounts[{$k}][{$smarty.section.co.index}][{$o_k}]" type="hidden" value="{$o_v|htmlspecialchars}" />
  251.                                             {/if}
  252.                                         </li>
  253.                                         {/if}
  254.                                     {/foreach}
  255.                                 </ul>
  256.                             </div>
  257.                         </div>
  258.                     {/if}
  259.                    
  260.                 </div>
  261.             </div>
  262.             <div class="cart-item__bottom">
  263.                 {if $fix_discount}
  264.                     <div class="cart-price">
  265.                         {if $e.is_pre_order}
  266.                             <div class="cart-price-preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
  267.                         {else}
  268.                             {if $product.price_old}
  269.                                 <div class="cart-price-old">{$product.price_old}</div>
  270.                             {/if}
  271.                             {$e.price|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  272.                         {/if}
  273.                     </div>
  274.                 {else}
  275.                     <div class="cart-price">
  276.                         {if $e.is_pre_order}
  277.                             <div class="cart-price-preorder">{$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}</div>
  278.                         {else}
  279.                             {if $product.price_old}
  280.                                 <div class="cart-price-old">{$product.price_old}</div>
  281.                             {/if}
  282.                             {$e.price|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  283.                         {/if}
  284.                     </div>
  285.                 {/if}
  286.                 <div class="cart-amount">
  287.                     {if $gift}
  288.                         <div class="cart-price-preorder">{$e.amount}</div>
  289.                     {else}
  290.                         <div class="shop2-product-amount">
  291.                             <button type="button" class="shop2-btn amount-minus">&#8722;</button>
  292.                                 {assign var="max" value=$product.amount}
  293.                                 {if ($shop2.product_amount_required == 0 && $product.pre_order == 0) || $product.pre_order == 4}
  294.                                     {assign var="max" value=0}
  295.                                 {/if}
  296.                                 <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}" />
  297.                             <button type="button" class="shop2-btn amount-plus">&#43;</button>
  298.                         </div>
  299.                     {/if}
  300.                 </div>
  301.                 {if $gift}
  302.                     <div class="cart-sum">
  303.                         0
  304.                     </div>
  305.                 {else}
  306.                     <div class="cart-sum">
  307.                         {if $e.is_pre_order}
  308.                             -
  309.                         {else}
  310.                             {if $fix_discount}
  311.                                 {if $e.custom_params[co].amount}
  312.                                     {$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}
  313.                                 {else}
  314.                                     {if count($discounts) > 0}
  315.                                         {$e.discount_sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  316.                                     {else}
  317.                                         {$e.sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  318.                                     {/if}
  319.                                 {/if}
  320.                             {else}
  321.                                 {if $e.params[co].amount}
  322.                                     {$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}
  323.                                 {else}
  324.                                     {if count($discounts) > 0}
  325.                                         {$e.discount_sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  326.                                     {else}
  327.                                         {$e.sum|price_convert} {if $shop2.my.price_fa_rouble}<span class="fa fa-rouble"></span>{else}<span>{$currency.currency_shortname}</span>{/if}
  328.                                     {/if}
  329.                                 {/if}
  330.                             {/if}
  331.                         {/if}
  332.                     </div>
  333.                     <div class="cart-delete">
  334.                         {strip}
  335.                         <a title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$k}" data-id="
  336.                             {if $e.params}
  337.                                 {ldelim}'{$k}':{ldelim}
  338.                                     {foreach from=$e.params[co] item=o_v key=o_k name=foo}
  339.                                         {if $o_k == 'amount'}
  340.                                             'amount': '0'
  341.                                         {else}
  342.                                             '{$o_k|htmlspecialchars}':'{$o_v|htmlspecialchars}'
  343.                                         {/if}
  344.                                         {if !$smarty.foreach.foo.last}, {/if}
  345.                                     {/foreach}
  346.                                 {rdelim}{rdelim}
  347.                             {else}
  348.                                 {$k}
  349.                             {/if}">
  350.                             {$shop2.my.gr_cart_delete_text|default:#SHOP2_REMOVE#}
  351.                         </a>
  352.                         {/strip}
  353.                     </div>
  354.                 {/if}
  355.             </div>
  356.         </div>
  357.     {/section}
  358. {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement