Igor150195

Новый шаблон кол-ва

Apr 22nd, 2020
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 1.80 KB | None | 0 0
  1. {assign var="pr" value=$product}
  2. {if $collection_list_item}
  3.     {assign var="pr" value=$collection_list_item}
  4. {/if}
  5. {assign var=amount_min value=$pr.params.amount_min}
  6. {assign var=multiplicity value=$pr.params.amount_multiplicity|default:1}
  7.  
  8. {if !$amount_min}
  9.     {if $multiplicity}
  10.         {assign var=amount_min value=$multiplicity}
  11.     {else}
  12.         {assign var=amount_min value=$shop2.my.amount_default|default:1}
  13.     {/if}
  14. {/if}
  15.  
  16. {if $pr.amount < 1 && $pr.amount != 0}
  17.     {assign var=amount_min value=$shop2.my.amount_default|default:$pr.amount}
  18. {/if}
  19. {if !$shop2.my.mode_catalog}
  20.     <div class="{$class}{if $pr.buy_mode == 1 && $shop2.my.enable_disabled_class} shop2-product-amount-disabled{/if}">
  21.         {if !$hideCaption}
  22.             <div class="amount-title">{#SHOP2_AMOUNT#}:</div>
  23.         {/if}
  24.         {if $pr.buy_mode == 1}
  25.             <div class="shop2-product-amount disabled">
  26.                 <button type="button" disabled="disabled">&#8722;</button><input type="text" maxlength="4" disabled="disabled" value="{$amount_min}" /><button type="button" disabled="disabled">&#43;</button>
  27.             </div>
  28.         {else}
  29.             <div class="shop2-product-amount">
  30.                 <button type="button" class="amount-minus">&#8722;</button><input type="text" name="amount" data-kind="{$pr.kind_id}" data-max="{$pr.amount}" data-min="{$amount_min}" data-multiplicity="{$multiplicity}" maxlength="4" value="{$amount_min}" /><button type="button" class="amount-plus">&#43;</button>
  31.             </div>
  32.             {if ($amount_min != 0 || $multiplicity != 0) && ($pr.params.amount_min || $pr.params.amount_multiplicity)}
  33.                 <div class="amount-min">
  34.                     {#FILTER_INT_FROM#|mb_strtolower} {$amount_min} {$pr.params.unit}
  35.                     {#FILTER_BY#|mb_strtolower} {if $multiplicity}{$multiplicity}{else}{if $pr.amount < 1 && $pr.amount != 0}{$pr.amount}{else}1{/if}{/if} {$pr.params.unit}
  36.                 </div>
  37.             {/if}
  38.         {/if}
  39.     </div>
  40. {/if}
Add Comment
Please, Sign In to add comment