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[$e.kind_id]}
- {section loop=$params_count name=co}
- {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}
- <tr>
- <td class="cart-product">
- <div class="cart-product-image{if !$product.image_filename} no-image{/if}">
- {if $product.image_filename}
- <a href="{$IMAGES_DIR}{$product.image_filename}">
- {assign var="cart_image_width" value=$shop2.my.cart_image_width|default:90}
- {assign var="cart_image_height" value=$shop2.my.cart_image_height|default:90}
- <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>
- <div class="verticalMiddle"></div>
- {/if}
- </div>
- <div class="cart-product-details">
- {if $gift}
- <div class="cart-product-action">
- <strong>{#SHOP2_GIFT#}</strong>
- {if isset($cart.gifts_diff_amount[$product.kind_id]) && $cart.gifts_diff_amount[$product.kind_id] > $product.amount}
- <div>{#S3_SHOP2_NOT_ENOUGH_GIFTS_IN_STOCK_MESSAGE#}</div>
- {/if}
- </div>
- {/if}
- {assign var="stock_status" value=$product.stock_status}
- {if $stock_status == 'not_enough'}
- <div class="cart-product-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-product-action">
- <strong>{#SHOP2_PRODUCT_DELETED#}</strong>
- <div class="shop2-tooltip" data-tooltip="{#SHOP2_PRODUCT_DELETED_TOOLTIP#|htmlspecialchars}"></div>
- </div>
- {/if}
- {/if}
- <div class="cart-product-name">
- <a {if $product.alias != "#"}href="{get_seo_url mode="product" alias=$product.alias}"{/if}>{$product.name}</a>
- </div>
- {include file="global:shop2.v2-product-article.tpl"}
- {if $e.discounts_applied|@count}
- <div class="cart-product-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}
- {if $cart.all.$key.promo && $discounts.$discount.discount_kind == 8}
- <span class="discount-promo">({if $cart.all.$key.promo.main}{#SHOP2_PROMO_MAIN_TITLE#}{else}{#SHOP2_PROMO_TITLE#}{/if})</span>
- {/if}
- {/foreach}
- </div>
- {/if}
- <ul class="cart-product-param">
- {foreach from=$product.meta item=op key=kop}
- {if $op}
- {assign var="option" value=$custom_fields.$kop}
- {if $option.in_cart || !isset($option.in_cart)} {* проверка *}
- {if ($option.type == 'text' || $option.type == 'int' || $option.type == 'float' || $option.type == 'textarea' || $option.type == 'html') && !$option.not_mod}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-value">{$op} {$option.unit|default:""}</div>
- </li>
- {elseif $option.type == 'checkbox'}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-value">{if $op == 1}{#SHOP2_YES#}{else}{#SHOP2_NO#}{/if}</div>
- </li>
- {elseif $option.type == 'color'}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-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="param-title">{$option.name}:</div>
- <div class="param-value">{$option.options.$op}</div>
- </li>
- {elseif $option.type == 'multiselect' && !$option.not_mod}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-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' && !$option.not_mod}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-value">
- <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' && !$option.not_mod}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-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="param-title">{$option.name}:</div>
- <div class="param-value">
- {include file="global:shop2.v2-color-ext.tpl" location="cart"}
- </div>
- </li>
- {elseif $option.type == 'coordinates'}
- {if $op.x}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-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}
- {elseif $option.type == 'date'}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-value">{$op}</div>
- </li>
- {elseif $option.type == 'date_interval'}
- <li>
- <div class="param-title">{$option.name}:</div>
- <div class="param-value">{#SHOP2_FROM#} {$op.from} - {#SHOP2_TO#} {$op.to}</div>
- </li>
- {/if}
- {/if}
- {/if}
- {/foreach}
- {foreach from=$e.params[$key] item=o_v key=o_k}
- {*if $o_k == 'id'}{continue}{/if*}
- {if $o_k!='amount' && $o_v}
- <li>
- {assign var="option" value=$custom_fields.$o_k}
- {assign var="parts" value=": "|explode:$o_v}
- {if $option.in_cart || !isset($option.in_cart)} {* проверка *}
- {*доп. поля с выбором при заказе*}
- {if $product.cf.$o_k.not_mod}
- {include file="global:shop2.v2-product-options-not-mod.tpl"}
- {else}
- {if $parts|@count == 2 && $option.type == 'color_ref' && $option.not_mod}
- <div class="param-title">{$parts[0]}: </div>
- <div class="param-value">
- {include file="global:shop2.v2-color-ext.tpl" location="cart" op=$parts[1]}
- </div>
- {else}
- <div class="param-title">{$o_v}</div>
- {/if}
- <input name="amounts[{$e.kind_id}][{$pos}][{$o_k}]" type="hidden" value="{$o_v|htmlspecialchars}" />
- {/if}
- {/if}
- </li>
- {/if}
- {/foreach}
- </ul>
- {if isset($cart.bonusParams.accrual_mode)}
- {if $cart.bonusParams.enabled && $cart.bonusParams.is_accrual && isset($user.user_id) && $product.bonus_value > 0 && !$cart.bonusParams.accrual_mode}
- <div>
- <span class="param-title">Бонус за товар:</span>
- <span class="param-value">{$e.bonus_value}</span>
- </div>
- {/if}
- {else}
- {if $cart.bonusParams.enabled && $cart.bonusParams.is_accrual && isset($user.user_id) && $e.bonus_value > 0}
- <div>
- <span class="param-title">Бонус за товар:</span>
- <span class="param-value">{$e.bonus_value}</span>
- </div>
- {/if}
- {/if}
- </div>
- </td>
- {if $fix_discount}
- <td class="cart-price">
- {if $e.is_pre_order}
- {$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}
- {else}
- {$e.price|price_convert}
- {/if}
- </td>
- {if $show_discount}
- <td class="cart-price">
- {$e.price_discounted|price_convert:"":"true":"false":"2"}
- </td>
- {/if}
- {*assign var=id value=$e.params[$key].id}
- <td class="cart-price">
- {if $e.is_pre_order}
- {$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}
- {else}
- {if $id}
- {$cart.all[$id].price|price_convert}
- {else}
- {$e.price|price_convert}
- {/if}
- {/if}
- </td>
- {if $show_discount}
- <td class="cart-price">
- {if $id}
- {$cart.all[$id].price_discounted|price_convert:"":"true":"false":"2"}
- {else}
- {$e.price_discounted|price_convert:"":"true":"false":"2"}
- {/if}
- </td>
- {/if*}
- {else}
- <td class="cart-price">
- {if $e.is_pre_order}
- {$shop2.my.preorder_alias|default:#SHOP2_PREORDER2#}
- {else}
- {$e.price|price_convert}
- {/if}
- </td>
- {/if}
- <td class="cart-amount">
- {if $gift}
- {$e.amount}
- {else}
- {assign var="amount_min" value=$product.params.amount_min}
- {if $product.params.amount_min !="" || $product.params.amount_multiplicity !=""}
- {assign var="multiplicity" value=$product.params.amount_multiplicity|default:1}
- {/if}
- {if !$amount_min}{if $multiplicity}{assign var=amount_min value=$multiplicity}{else}{assign var="amount_min" value=$shop2.my.amount_default|default:1}{/if}{/if}
- <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 {if $shop2.product_amount_required=='1' || $product.buy_mode==1}data-max="{$max}"{/if} data-kind="{$product.kind_id}" name="{if $e.params}amounts[{$e.kind_id}][{$pos}][amount]{else}amounts[{$e.kind_id}]{/if}" type="text" maxlength="4" value="{if $e.params[$key].amount}{$e.params[$key].amount}{else}{$e.amount}{/if}" data-min="{$amount_min}" data-multiplicity="{$multiplicity}" />
- <button type="button" class="shop2-btn amount-plus">+</button>
- </div>
- {*if $amount_min > 0 || $multiplicity > 0*}
- {if $multiplicity > 0} {*id1552*}
- <div class="amount-min">
- {#FILTER_INT_FROM#|mb_strtolower} {$amount_min} {$product.params.unit}
- {#FILTER_BY#|mb_strtolower} {if $multiplicity}{$multiplicity}{else}1{/if} {$product.params.unit}
- </div>
- {/if}
- {/if}
- </td>
- {if $gift}
- <td class="cart-price">0</td>
- <td> </td>
- {else}
- <td class="cart-price">
- {if $e.is_pre_order}
- -
- {else}
- {if $fix_discount}
- {if $e.custom_params[$key].amount}
- {$e.custom_params[$key].total|price_convert}
- {else}
- {if count($discounts) > 0}
- {$e.discount_sum|price_convert}
- {else}
- {$e.sum|price_convert}
- {/if}
- {/if}
- {else}
- {if $e.params[$key].amount}
- {$e.params[$key].amount*$e.price|price_convert}
- {else}
- {if count($discounts) > 0}
- {$e.discount_sum|price_convert}
- {else}
- {$e.sum|price_convert}
- {/if}
- {/if}
- {/if}
- {/if}
- </td>
- <td class="cart-delete">
- {strip}
- <a title="{#SHOP2_REMOVE#}" href="{$shop2.uri}?mode=cart&action=del&kind_id={$e.kind_id}" data-id="
- {if $e.params}
- {ldelim}'{$e.kind_id}':{ldelim}
- {foreach from=$e.params[$key] 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}
- {$e.kind_id}
- {/if}">
- <img src="/g/shop2v2/default/images/delete-cart-product.png" height="15" width="15" alt="" />
- </a>
- {/strip}
- </td>
- {/if}
- </tr>
- {if !$cart.tax.show_common_tax && $e.tax.active}
- <tr>
- <td>{#SHOP2_INCLUDING_VAT#|sprintf:$e.tax.name}</td>
- <td colspan="{if $fix_discount && $show_discount}3{else}2{/if}">{$e.tax.percent}%</td>
- <td colspan="2">{$e.tax.value|price_convert}</td>
- </tr>
- {/if}
- {/section}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement