Advertisement
valeraplusplus

shop2.v2-product-options-not-mod.tpl Наценка

Apr 14th, 2022
1,411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 7.22 KB | None | 0 0
  1. {assign var="cfield_type" value=$custom_fields.$o_k.type}
  2. {assign var="cfield_code" value=$custom_fields.$o_k.code}
  3.  
  4. {if $site.reg.shop2.cf_margin_price_enabled && isset($e.position)}
  5.     {*позиция*}
  6.     {assign var=pos value=$e.position[$k]}
  7.     {*уникальный ключ итема*}
  8.     {assign var=key value=$k}
  9.     {else}
  10.     {*позиция*}
  11.     {assign var=pos value=$smarty.section.co.index}
  12.     {*ключ итема*}
  13.     {assign var=key value=$smarty.section.co.index}
  14. {/if}
  15.  
  16. {if $cfield_type == "multiselect"}
  17.  
  18.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  19.    
  20.     <select name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="param-value additional-cart-params">
  21.     {foreach from=$product.meta.$o_k item=opt}
  22.     <option
  23.            value="{$option.name}: {$custom_fields.$o_k.options.$opt}"
  24.            {if $e.custom_params[$key].fields.$o_k.item_id == $opt} selected{/if}
  25.    >
  26.     {$custom_fields.$o_k.options.$opt}
  27.     </option>
  28.     {/foreach}
  29.     </select>
  30.     {*
  31.     <select name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="param-value additional-cart-params">
  32.     {foreach from=$product.meta.$o_k item=opt}
  33.     <option
  34.             value="{$option.name}: {$custom_fields.$o_k.options.$opt}"
  35.             {if $e.custom_params[$key].fields.$o_k.item_id == $opt} selected{/if}
  36.     >
  37.     {if $shop2.calc_custom_fields}
  38.         {$product.cf_select.$o_k.$opt}
  39.     {else}
  40.         {$custom_fields.$o_k.options.$opt}
  41.     {/if}
  42.     </option>
  43.     {/foreach}
  44.     </select>*}
  45. {elseif $cfield_type == "color_ref"}
  46.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  47.     {assign var="values" value=$product.meta[$option.code]}
  48.     <div class="shop2-color-ext-select">
  49.         <i></i>
  50.         <ul class="shop2-color-ext-options">
  51.             {foreach from=$values item=v name=foo}
  52.             {assign var="index" value=$smarty.foreach.foo.index}
  53.             {assign var="val" value=$option.options[$v]}
  54.            
  55.             <li data-value="{$option.name|escape}: {$v}" class="param-value{if $e.custom_params[$key].fields.$o_k.item_id == $v} shop2-color-ext-selected{/if}">
  56.                 <span style="{if $cf_images[$val.image.image_id]}background-image: url({s3_img src=$cf_images[$val.image.image_id] width=22 height=22 method="c"}){else}background-color:{$val.code}{/if}"><em></em></span>
  57.                 <div>{$val.text}</div>
  58.                 <ins></ins>
  59.             </li>
  60.             {*<li data-value="{$option.name|escape}: {$v}" class="param-value{if $e.custom_params[$key].fields.$o_k.item_id == $v} shop2-color-ext-selected{/if}">
  61.                 <span style="{if $cf_images[$val.image.image_id]}background-image: url({s3_img src=$cf_images[$val.image.image_id] width=22 height=22 method="c"}){else}background-color:{$val.code}{/if}"><em></em></span>
  62.                 <div>
  63.                     {if $shop2.calc_custom_fields}
  64.                         {$product.cf_select.$o_k.$v.text}
  65.                     {else}
  66.                         {$val.text}
  67.                     {/if}
  68.                 </div>
  69.                 <ins></ins>
  70.             </li>*}
  71.             {if $e.custom_params[$key].fields.$o_k.item_id == $v}
  72.             {capture assign="selected"}{strip}
  73.             {$option.name|htmlspecialchars}: {$v}
  74.             {/strip}{/capture}
  75.             {/if}
  76.             {/foreach}
  77.         </ul>
  78.         <input type="hidden" class="additional-cart-params" value="{$selected}" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]">
  79.     </div>
  80. {elseif $cfield_type == 'file2'}
  81.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  82.     <div class="param-value">
  83.         {if $e.custom_params[$key].fields[$cfield_code].value}
  84.             <input type="hidden" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}">
  85.             <a href="/u/{$e.custom_params[$key].fields[$cfield_code].value}">{#SHOP2_DOWNLOAD#}</a>
  86.             <br>
  87.             <span class="delete-upload-file shop2-btn" onclick="shop2.product.deleteUploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#LINKS_DELETE#}</span>
  88.         {else}
  89.             <input type="file" id="_upload_in_cart_{$e.kind_id}_{$pos}_{$o_k}">
  90.             <span class="shop2-btn shop2-upload-btn" onclick="shop2.product.uploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#DOWNLOAD#}</span>
  91.         {/if}
  92.     </div>
  93. {elseif $cfield_type == 'image2'}
  94.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  95.     <div class="param-value">
  96.         {if $e.custom_params[$key].fields[$cfield_code].value}
  97.             <input type="hidden" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}">
  98.             <a href="/u/{$e.custom_params[$key].fields[$cfield_code].value}">
  99.             {assign var="cart_other_image_width" value=$shop2.my.cart_other_image_width|default:90}
  100.             {assign var="cart_other_image_height" value=$shop2.my.cart_other_image_height|default:90}
  101.             <img src="{s3_img width=$cart_other_image_width height=$cart_other_image_height src=$e.custom_params[$key].fields[$cfield_code].value method=$shop2.my.s3_img_method dir="u"}" />
  102.             </a>
  103.             <br>
  104.             <span class="delete-upload-file shop2-btn" onclick="shop2.product.deleteUploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#LINKS_DELETE#}</span>
  105.         {else}
  106.             <input type="file" id="_upload_in_cart_{$e.kind_id}_{$pos}_{$o_k}">
  107.             <span class="shop2-btn shop2-upload-btn" onclick="shop2.product.uploadInCart({$e.kind_id}, {$pos}, '{$o_k}', true, {ldelim}'width':90,'height':90{rdelim})">{#DOWNLOAD#}</span>
  108.         {/if}
  109.     </div>
  110. {elseif $cfield_type=='text' || $cfield_type=='int' || $cfield_type=='float'}
  111.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  112.     <div class="param-value">
  113.         <input type="text" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}" class="additional-cart-params">
  114.     </div>
  115. {elseif $cfield_type=='textarea'}
  116.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  117.     <div class="param-value">
  118.         <textarea name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="additional-cart-params">{$e.custom_params[$key].fields[$cfield_code].value}</textarea>
  119.     </div>
  120. {elseif $cfield_type=='date'}
  121.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  122.     <div class="param-value">
  123.         <input type="text" size="10" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}" class="additional-cart-params shop2-date">
  124.     </div>
  125. {elseif $cfield_type=='date_interval'}
  126.     <div class="param-title">{$custom_fields.$o_k.name}</div>
  127.     <div class="param-value">
  128.         <div class="shop2-date-from">
  129.             <span>{#SHOP2_FROM#}</span>
  130.             <input type="text" size="10" name="amounts[{$e.kind_id}][{$pos}][{$o_k}][from]" value="{$e.custom_params[$key].fields[$cfield_code].value.from}" class="additional-cart-params shop2-date_interval">
  131.         </div>
  132.         <div class="shop2-date-to">
  133.             <span>{#SHOP2_TO#}</span>
  134.             <input type="text" size="10" name="amounts[{$e.kind_id}][{$pos}][{$o_k}][to]" value="{$e.custom_params[$key].fields[$cfield_code].value.to}" class="additional-cart-params shop2-date_interval">
  135.         </div>
  136.     </div>
  137. {/if}
  138. {if $errors.items_errors[$e.kind_id][$key][$o_k]}<small style="font-size:10px; line-height:1; color:red">{$errors.items_errors[$e.kind_id][$key][$o_k]|l}</small>{/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement