Files
kupshop/web/templates/x/product/product.charges.tpl
2025-08-02 16:30:27 +02:00

49 lines
2.1 KiB
Smarty

{* @compiler:inline-only *}
{if $body.product}
{$product = $body.product}
{$charges = $product->fetchCharges()}
{elseif $product}
{$charges = $product->getCharges()}
{/if}
{if $product.charges}
<div class="product-charges" data-tooltip-wrapper>
{foreach $product.charges as $charge}
{if $charge.figure == 'N'}{continue}{/if}
<label class="custom-control custom-checkbox {if $charge.required == 'Y'}disabled{/if}">
{if $charge.required == "Y"}
<input type="hidden" name="note[charges][{$charge.id}]" value="Y" data-charge-input>
{else}
<input type="checkbox" name="note[charges][{$charge.id}]" value="Y" class="custom-control-input" data-charge-input>
<span class="custom-control-indicator"></span>
{/if}
{if $charge.product}
{get_photos type='products' id=$charge.product.id assign='product_photos'}
<span class="title">+</span>
<a class="charge-product" href="{url s=product IDproduct=$charge.product.id TITLE=$charge.product.title}">
<div class="img">
<img src="{get_photo photo=$product_photos[0] size='product_cart'}"
alt="{$charge.product.title}" width="{$cfg.Photo.types.product_cart.size[0]}"
height="{$cfg.Photo.types.product_cart.size[1]}" class="img-responsive">
</div>
{block "charge-product-title"}
<span class="product-title">{$charge.product.title}</span>
{/block}
</a>
{else}
<span class="title">{$charge.title|default:$charge.admin_title}</span>
{/if}
<strong class="price">{$charge.price|format_price}</strong>
{if $charge.descr}
<i class="fc icons_tooltip charge-tooltip">
<span class="wpj-tooltip">{$charge.descr|strip_tags}</span>
</i>
{/if}
</label>
{/foreach}
</div>
{/if}