Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 04-30-2024 11:43:22

Registered: 04-29-2024
Posts: 77

Adding Discount Modification to Checkout

NOTE: This post was created on 2024-02-09 on the Kryptronic eCommerce Community facebook page, which has been replaced with this forum.  All facebook support content was migrated into this forum in April 2024.


Back in Europacart v8 I added the following code to private/apps/ecom/ECOM_Checkout/ECOM_Checkout.php to ensure that a 10 discount was only available for orders of 50 or more.

With the Kryptronic 9.3 update, this has been overwritten and ECOM_Checkout.php has been changed, so I'm not sure where to add it.

Please can someone tell me if a) this code will work and b) where it should be added (NB I know I will need to create a folder in the Custom directory with the required path)
* * * * *
// +--
// | Added this code to ensure welcome10 discount is only available on orders equal to or over 50
// +--
$subtotal = 0; foreach ($this->cartids as $cartid =>$item) {$subtotal += $item['subtotal'];}
if ($codedb['id'] == 'welcome10' && $subtotal < 50) {return false;}
* * * * *


You would add that to the same function - ECOM_Checkout::cocalcdiscount(). You could add that right after the line:

$codedb = $codes[0];

Which is near the top of the function right after the code is pulled from the database.



Board footer