Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {assign var="cfield_type" value=$custom_fields.$o_k.type}
- {assign var="cfield_code" value=$custom_fields.$o_k.code}
- {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}
- {if $cfield_type == "multiselect"}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <select name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="param-value additional-cart-params">
- {foreach from=$product.meta.$o_k item=opt}
- <option
- value="{$option.name}: {$custom_fields.$o_k.options.$opt}"
- {if $e.custom_params[$key].fields.$o_k.item_id == $opt} selected{/if}
- >
- {$custom_fields.$o_k.options.$opt}
- </option>
- {/foreach}
- </select>
- {*
- <select name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="param-value additional-cart-params">
- {foreach from=$product.meta.$o_k item=opt}
- <option
- value="{$option.name}: {$custom_fields.$o_k.options.$opt}"
- {if $e.custom_params[$key].fields.$o_k.item_id == $opt} selected{/if}
- >
- {if $shop2.calc_custom_fields}
- {$product.cf_select.$o_k.$opt}
- {else}
- {$custom_fields.$o_k.options.$opt}
- {/if}
- </option>
- {/foreach}
- </select>*}
- {elseif $cfield_type == "color_ref"}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- {assign var="values" value=$product.meta[$option.code]}
- <div class="shop2-color-ext-select">
- <i></i>
- <ul class="shop2-color-ext-options">
- {foreach from=$values item=v name=foo}
- {assign var="index" value=$smarty.foreach.foo.index}
- {assign var="val" value=$option.options[$v]}
- <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}">
- <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>
- <div>{$val.text}</div>
- <ins></ins>
- </li>
- {*<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}">
- <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>
- <div>
- {if $shop2.calc_custom_fields}
- {$product.cf_select.$o_k.$v.text}
- {else}
- {$val.text}
- {/if}
- </div>
- <ins></ins>
- </li>*}
- {if $e.custom_params[$key].fields.$o_k.item_id == $v}
- {capture assign="selected"}{strip}
- {$option.name|htmlspecialchars}: {$v}
- {/strip}{/capture}
- {/if}
- {/foreach}
- </ul>
- <input type="hidden" class="additional-cart-params" value="{$selected}" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]">
- </div>
- {elseif $cfield_type == 'file2'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- {if $e.custom_params[$key].fields[$cfield_code].value}
- <input type="hidden" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}">
- <a href="/u/{$e.custom_params[$key].fields[$cfield_code].value}">{#SHOP2_DOWNLOAD#}</a>
- <br>
- <span class="delete-upload-file shop2-btn" onclick="shop2.product.deleteUploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#LINKS_DELETE#}</span>
- {else}
- <input type="file" id="_upload_in_cart_{$e.kind_id}_{$pos}_{$o_k}">
- <span class="shop2-btn shop2-upload-btn" onclick="shop2.product.uploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#DOWNLOAD#}</span>
- {/if}
- </div>
- {elseif $cfield_type == 'image2'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- {if $e.custom_params[$key].fields[$cfield_code].value}
- <input type="hidden" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}">
- <a href="/u/{$e.custom_params[$key].fields[$cfield_code].value}">
- {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=$e.custom_params[$key].fields[$cfield_code].value method=$shop2.my.s3_img_method dir="u"}" />
- </a>
- <br>
- <span class="delete-upload-file shop2-btn" onclick="shop2.product.deleteUploadInCart({$e.kind_id}, {$pos}, '{$o_k}')">{#LINKS_DELETE#}</span>
- {else}
- <input type="file" id="_upload_in_cart_{$e.kind_id}_{$pos}_{$o_k}">
- <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>
- {/if}
- </div>
- {elseif $cfield_type=='text' || $cfield_type=='int' || $cfield_type=='float'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- <input type="text" name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" value="{$e.custom_params[$key].fields[$cfield_code].value}" class="additional-cart-params">
- </div>
- {elseif $cfield_type=='textarea'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- <textarea name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" class="additional-cart-params">{$e.custom_params[$key].fields[$cfield_code].value}</textarea>
- </div>
- {elseif $cfield_type=='date'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- <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">
- </div>
- {elseif $cfield_type=='date_interval'}
- <div class="param-title">{$custom_fields.$o_k.name}</div>
- <div class="param-value">
- <div class="shop2-date-from">
- <span>{#SHOP2_FROM#}</span>
- <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">
- </div>
- <div class="shop2-date-to">
- <span>{#SHOP2_TO#}</span>
- <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">
- </div>
- </div>
- {/if}
- {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