Files
grzanieplus.pl/plugins/stDeliveryPlugin/modules/stDeliveryBackend/templates/_express_delivery_cost.php
2025-03-12 17:06:23 +01:00

48 lines
1.8 KiB
PHP

<?php
use_helper('stPrice');
$error_netto = form_has_error('delivery{express_delivery_cost_netto}');
$error_brutto = form_has_error('delivery{express_delivery_cost_brutto}');
/**
* @var Delivery $delivery
*/
?>
<table id="express_delivery_container" class="st_record_list" cellspacing="0">
<thead>
<tr>
<th><b><?php echo __('Netto') ?></b></th>
<th><b><?php echo __('Brutto') ?></b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php echo input_tag ('delivery[express_delivery_cost_netto]', st_price_format($delivery->getExpressDeliveryCostNetto()), array(
'size' => 8,
'style' => $error_netto ? 'border-color: #FF3333' : '',
'disabled' => !$delivery->getIsExpressDelivery()
)) ?>
</td>
<td>
<?php echo input_tag ('delivery[express_delivery_cost_brutto]', st_price_format($delivery->getExpressDeliveryCostBrutto()), array(
'size' => 8,
'style' => $error_brutto ? 'border-color: #FF3333' : '',
'disabled' => !$delivery->getIsExpressDelivery()
)) ?>
</td>
</tr>
</tbody>
</table>
<?php st_price_tax_manager_add_price_field(array('price' => 'delivery_express_delivery_cost_netto', 'priceWithTax' => 'delivery_express_delivery_cost_brutto')); ?>
<script>
jQuery(function($) {
var container = $('#express_delivery_container');
$('#delivery_is_express_delivery').change(function() {
var enabled = $(this).prop('checked');
container.find('input').add('#delivery_always_charge_express_delivery_cost').prop('disabled', !enabled);
}).change();
});
</script>