From 562d94619447e04875ca95711eb50aa8ea2b66d1 Mon Sep 17 00:00:00 2001 From: totoW <anthony.weiss1910@gmail.com> Date: Fri, 12 Jan 2024 12:37:44 +0100 Subject: [PATCH] L --- startbootstrap-agency-gh-pages/checkout.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/startbootstrap-agency-gh-pages/checkout.php b/startbootstrap-agency-gh-pages/checkout.php index fa7cda8..17f70f8 100644 --- a/startbootstrap-agency-gh-pages/checkout.php +++ b/startbootstrap-agency-gh-pages/checkout.php @@ -105,7 +105,7 @@ echo $text; <li class="list-group-item d-flex justify-content-between bg-light"> <div class="text-success"> <h6 class="my-0">Promo code</h6> - <small>EXAMPLECODE</small> + <small id = "idCodeshow"></small> </div> <span class="text-success"></span> </li> @@ -329,12 +329,19 @@ echo $text; console.log(response); totalPrice = totalPrice - (totalPrice * discount); // Appliquer la remise console.log(totalPrice); + var discountInfo = ""; + if (discount) { + discountInfo += "Promo Code Applied: " + promoCode; + discountInfo += " - Discount: " + (discount * 100) + "%"; + } // Update the displayed total price $("strong").text(totalPrice.toFixed(2) + " €"); + + // Update the discount information in the small tag + $("#idCodeshow").text(discountInfo); + + }, - error: function() { - // En cas d'erreur, ne rien faire ou afficher un message d'erreur - } }); } @@ -378,7 +385,7 @@ echo $text; data: data, success: function(response) { // Redirect to the thank you page upon successful response - // window.location.href = 'thank_you_page.php'; + window.location.href = 'thank_you_page.php'; }, error: function() { // Handle error if needed -- GitLab