From f04268bc6aadbee5ec47667df77fd9414180964c Mon Sep 17 00:00:00 2001 From: Andrey Kuvshinov Date: Sat, 8 Oct 2022 10:49:19 +0000 Subject: [PATCH] add js delivery checkout.phtml --- app/views/checkout.phtml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/app/views/checkout.phtml b/app/views/checkout.phtml index fd0f56d..8487b6a 100644 --- a/app/views/checkout.phtml +++ b/app/views/checkout.phtml @@ -8,23 +8,20 @@ var itog = product_price; var itog_el = document.getElementById("span_itog"); var count = document.getElementById('count').value; - - - if (document.getElementById('devilery_id1').checked) { - itog = product_price * count; - } - else if (document.getElementById('devilery_id2').checked){ - itog = product_price * count; - itog = itog + 300; - } - else if (document.getElementById('devilery_id3').checked){ - itog = product_price + 300; - itog = itog * count; - } - else if (document.getElementById('devilery_id4').checked){ - itog = product_price + 450; - itog = itog * count; - } + + + + + if (document.getElementById('devilery_id').checked) { + + else if (document.getElementById('devilery_id').checked){ + + itog = product_price * count; + + itog = itog + ; + + + itog_el.innerHTML = itog + ' руб.';