add postprice in checkout.phtml

This commit is contained in:
Andrey Kuvshinov
2022-10-07 18:15:47 +00:00
parent 3b0ff65854
commit 9ae311c748

View File

@@ -1,8 +1,15 @@
<?if ($price_id['weight'] > 499){
$postprice = 450;
}
else {
$postprice = 300;
}?>
<script> <script>
var product_price = <?=$price_id['offline_price']?>; var product_price = <?=$price_id['offline_price']?>;
var postprice = <?=$postprice?>;
function itog(){ function itog(){
var itog = product_price; var itog = product_price;
@@ -18,7 +25,7 @@
itog = itog + 300; itog = itog + 300;
} }
else if (document.getElementById('devilery_id3').checked){ else if (document.getElementById('devilery_id3').checked){
itog = product_price + 300; itog = product_price + postprice;
itog = itog * count; itog = itog * count;
} }
@@ -99,7 +106,9 @@
$checked = ($ditem['delivery_id'] == $delivery_id) ? ' checked': '';?> $checked = ($ditem['delivery_id'] == $delivery_id) ? ' checked': '';?>
<p><input name="delivery_id" type="radio" id="devilery_id<?=$dd?>" onclick="devilery_check();" value="<?=$ditem['delivery_id']?>"<?=$checked?>> <p><input name="delivery_id" type="radio" id="devilery_id<?=$dd?>" onclick="devilery_check();" value="<?=$ditem['delivery_id']?>"<?=$checked?>>
<?=$ditem['delivery']?> <?=$ditem['delivery']?>
<?if ($ditem['delivery_price'] > 0):?> <?if ($ditem['delivery_id'] == 4):?>
+ <?= $postprice?> руб.
<?elseif ($ditem['delivery_price'] > 0):?>
+ <?=$ditem['delivery_price']?> руб. + <?=$ditem['delivery_price']?> руб.
<?endif?> <?endif?>
</p> </p>