Page 1 of 1

Discount Codes

Posted: Sat Mar 20, 2021 3:59 pm
by raiwa
This Addon allows to create discount codes for to apply on checkout as a percentatge or fixed discount amount on order total.
Several possibilities to restrict the discount on categories, manufacturers, products or exclude products and assign to certail customers. Allows to limit the number of uses, establish minimum order total or limit to the first, second etc. order of a customer or to customers subscribed to newsletters.

https://www.oscaddons.com/en/free-add-o ... -p-79.html

Based on Discount Codes BS 3.x and 4.x by @Tsimi and @raiwa
Based on the Discount Code for osCommerce 2.3.1 addon by high-quality-php-coding.com

Re: Discount Codes

Posted: Sat Mar 20, 2021 4:01 pm
by raiwa
Updated Version 5.4.1

Compatibility:
Phoenix 1.0.7.14+
Tested with Phoenix 1.0.8.0
Tested with PayPal standard ipn and Stripe SCA 3.0 version stripe_sca_v1.1.0r1
PHP 7.0-7.4

----------------------
Version 5.4.1. Tested with Phoenix Cart 1.0.8.0
Fixed wrong database Field type from "int" to "text" for categories, products. manufacturers, excluded products and customers. Thanks to @vmn to point it out
Modified installation script to fix these wrong types on installation/update.
Fixed javascript in admin/discount_codes.php to keep excluded product list enabled if categories or manufacturers are selected.

Re: Discount Codes

Posted: Sat Mar 27, 2021 6:08 pm
by gsmiley007
ver: 1.0.8.0

Allow discount code without login.
Apply discount.

Get these errors:

Error Code: 8511 Error Msg: An error occurred while handling the request. Please try again or contact the support line.

Warning: Invalid argument supplied for foreach() in includes/system/versioned/1.0.7.4/shipping.php on line 99

Notice: Undefined index: customer_id in includes/modules/order_total/ot_discount.php on line 60

Notice: Undefined index: customer_id in includes/modules/order_total/ot_discount.php on line 86

Notice: Undefined index: customer_id in includes/modules/order_total/ot_discount.php on line 145

Re: Discount Codes

Posted: Sat Mar 27, 2021 7:09 pm
by raiwa
Hi,

These errors:
Error Code: 8511 Error Msg: An error occurred while handling the request. Please try again or contact the support line.

Warning: Invalid argument supplied for foreach() in includes/system/versioned/1.0.7.4/shipping.php on line 99
Seems to be related to the ship in cart module, not the discount module.
Depending on your shipping modules, you may need to add state and zip code with default values, It seems one of your shipping modules requires this for to retrieve a quote.

I'll have a look and fix the dicount notice errors.
Thanks for the advice.

Re: Discount Codes

Posted: Sat Mar 27, 2021 7:27 pm
by gsmiley007
thanks for looking.

I have both your ship in cart and store pickup modules installed.

I have set defaults for
country, state/province, post code and city

Re: Discount Codes

Posted: Sun Mar 28, 2021 9:24 am
by raiwa
Hi @gsmiley007,

There was an error intoduced in the 5.4.0 update for not logged in users in the shopping cart which prevented also the discount codes to get correct validated.

http://www.oscaddons.com/pub/Discount_C ... hoenix.zip

I fixed it. Please try this version. You only need to replace the order total module:
includes/modules/order_total/ot_discount.php

The package is not final, I'll research and maybe fix som other minor issues.

please try and let me know.

regards
Rainer

Re: Discount Codes

Posted: Mon Mar 29, 2021 9:19 am
by raiwa
Available update version 5.4.2:

https://www.oscaddons.com/en/free-add-o ... -p-79.html
  • Fixed notice error and not applying discount on the shopping cart page for guests/not logged in customers. Thanks to @gsmiley007 to point it out
  • Fixed notice error in shopping cart if no shipping is available.
  • More code modernization to match core standards.

Re: Discount Codes

Posted: Tue Mar 30, 2021 11:37 am
by admin
Support for this Addon will now be available on the Addon page - app.php/addons/free_addon/discount_codes/support