Files
kupshop/admin/templates/utils/priceDropdown.tpl
2025-08-02 16:30:27 +02:00

33 lines
1.3 KiB
Smarty

{*
$fieldName - fieldname prefix
$price - price without vat
$vat - vat
$withoutVat - state of dropdown
$currency - currency
$fieldAttributes - additional input attributes
*}
{if !$dropDownIndex}
{assign var=$dropDownIndex value=1 scope='global'}
{/if}
<div class="input-group" id="priceBuyVatDropdown-{$dropDownIndex}">
<input type="text" class="form-control input-sm" name="{$fieldName}[value]" data-price value="{$price}" {$fieldAttributes}/>
<input type="hidden" name="{$fieldName}[with_vat]" data-price-vat value="">
<input type="hidden" name="{$fieldName}[vat]" data-vat value="{$vat}">
<span class="input-group-addon">{$currency|default:$dbcfg.currency}</span>
<div class="input-group-btn" data-dropdown="">
<a class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">
<span data-dropdown-state=""></span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a data-value="1">{'withTax'|translate:'choice'}</a></li>
<li><a data-value="0">{'withoutTax'|translate:'choice'}</a></li>
</ul>
</div>
</div>
<script type="text/javascript">
priceVatDropdown($('#priceBuyVatDropdown-{$dropDownIndex}'), {if $withoutVat}0{else}1{/if});
</script>