Discount Codes

Open to all! Ask other shopowners for help.
Locked
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Discount Codes

Post 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
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27


Join The Code Co-op to get access to your library in the Code Co-op Forum
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Discount Codes

Post 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.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 2 times

Re: Discount Codes

Post 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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Discount Codes

Post 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.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
gsmiley007
Member
Posts: 82
Joined: Sun Mar 14, 2021 9:28 pm
Phoenix Version:
Has thanked: 9 times
Been thanked: 2 times

Re: Discount Codes

Post 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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Discount Codes

Post 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
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Discount Codes

Post 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.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
admin
Contributor
Posts: 217
Joined: Wed Oct 30, 2019 1:34 pm
Phoenix Version:
Has thanked: 20 times
Been thanked: 22 times

Re: Discount Codes

Post by admin »

Support for this Addon will now be available on the Addon page - app.php/addons/free_addon/discount_codes/support


Join The Code Co-op to get access to your library in the Code Co-op Forum
Locked