Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

TTHANKS! Great support! Installed and in the process of testing locally. One question comes to mind. Are codes 'case' sensitive? Will '1234DEC' work the same as '1234dec'?

Tom

Share this post


Link to post
Share on other sites
TTHANKS! Great support! Installed and in the process of testing locally. One question comes to mind. Are codes 'case' sensitive? Will '1234DEC' work the same as '1234dec'?

Tom

 

 

Codes are case insensitive.

 

abc = ABC


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Thanks. New problem.

 

Fatal error: Cannot redeclare class discount_coupon in c:\EasyPHP1-8\www\catalog\includes\classes\discount_coupon.php on line 14

 

Yes, I read the docs.

 

Problem:

Fatal error: Cannot redeclare class discount_coupon in

***path to shop***/includes/classes/discount_coupon.php on line 14.

 

Solution:

Edit the file includes/classes/discount_coupon.php and comment out the line

require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );

 

I would do this, but 'require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );' is NOT in the file to comment out?

 

Tom

using 2.1 & new install of this contrib.

Share this post


Link to post
Share on other sites
Thanks. New problem.

 

Fatal error: Cannot redeclare class discount_coupon in c:\EasyPHP1-8\www\catalog\includes\classes\discount_coupon.php on line 14

 

Yes, I read the docs.

 

Problem:

Fatal error: Cannot redeclare class discount_coupon in

***path to shop***/includes/classes/discount_coupon.php on line 14.

 

Solution:

Edit the file includes/classes/discount_coupon.php and comment out the line

require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );

 

I would do this, but 'require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );' is NOT in the file to comment out?

 

Tom

using 2.1 & new install of this contrib.

 

That should read

 

Solution:

Edit the file includes/modules/order_total/ot_discount_coupon.php and comment out the line

require_once( DIR_FS_CATALOG.DIR_WS_CLASSES.'discount_coupon.php' );


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

THANKS! That did it! Best support I've ever received in all the years I've been involved with osc. Wish I could return the favor.

Tom

Share this post


Link to post
Share on other sites
THANKS !

This seems to work fine for the discount line itself. However, the next lines (e.g. subtotal) are still calculated without this rounding. Could some logic be applied to the subtotal (and total ?) please ?

I guess the new rounded discount value needs to picked up when displaying the subtotal line rather then the original not-rounded amount.

e.g.

products : 104.00

discount 5% : 5.00 (original 5.22)

subtotal : 98.78 (this should be in fact 99 now because 104-5=99)

shipping: 6.20

Total : 104.98 (this should be in fact 105.20 now)

 

Could you help me with this or would it require a total re-design of the standard subtotal/total oscommerce logic ?

 

 

If this were easy to do, the discounts would never have a chance of being off in the first place.

 

I am working on a version (almost complete) that will be more accurate. Indeed, I haven't been able to figure out how to get inaccurate totals with it yet - a good sign. With that version, you should be able to do what you want easily enough.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

kgt, Everything is working fine locally, BUT, I'm getting a lousy 1064 error in admin on the live site after installing.

 

Discount Coupons NOTICE: Click here to read the Discount Coupon Codes manual for help editing coupons.

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-12, 12' at line 1

 

select * from discount_coupons cd order by cd.coupons_date_end, coupons_date_start limit -12, 12

 

Update for anyone else having this problem.

 

Found the solution here:

 

http://www.oscommerce.com/community/bugs,1605

(look for the post dated april 15 05)

 

This is a bug in oscommerce

admin->includes->classes->split_page_result.php file.

 

Error code :

Approximate Line : 34

Function : splitPageResults

 

LOOK FOR

 

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

This creates a problem if there is no record in database.

 

Fix ( Replace the above two lines with this code )

 

$offset = 0;

if($current_page_number > 0){

$offset = ($max_rows_per_page * ($current_page_number - 1));

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

 

Seems to be working now.

Share this post


Link to post
Share on other sites

Is it possible to change the coupon box from checkout_payment to checkout_shipping? I am using a shortened checkout and paypal ipn. My customers never go go checkout_payment.

Share this post


Link to post
Share on other sites

I have installed the coupon module (it is great, thanx to whom ever did this!).

 

I'm having a problem though:

 

I have created 1 discount coupon of '12345'. The 'Do you have a promotional code or discount coupon?' appears on my Payment Information screen. When i press 'continue' The page refreshes and my CC info and Coupon Code is no longer there.

 

I notice the URL is listed as:

checkout_payment.php?error_message=The+coupon+code+you+have+entered+is+not+valid.&osCsid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

It does not seem to be able to reference my coupon code, what am I doing wrong?

 

Any help is appreciated - thanx

Share this post


Link to post
Share on other sites
I have created 1 discount coupon of '12345'. The 'Do you have a promotional code or discount coupon?' appears on my Payment Information screen. When i press 'continue' The page refreshes and my CC info and Coupon Code is no longer there.

 

I notice the URL is listed as:

checkout_payment.php?error_message=The+coupon+code+you+have+entered+is+not+valid.

 

It does not seem to be able to reference my coupon code, what am I doing wrong?

 

 

This can happen if you enter your dates in the incorrect format. The format expected is taken from admin/includes/languages/english.php. If the format in that file is mm/dd/yyyy, then you will have this problem if you try to enter a date as dd/mm/yyyy.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Hi All,

 

I was wondering if anyone has expanded on this contribution to allow it to offer a coupon code that will offer free shipping and just drop the shipping charge when the coupon code is entered?

 

Any help is appriciated.

 

Regards,

Jp


Jp Jakubik

ProPoint Technologies, LLC

ProPoint Technologies - Baltimore Information Technology Solutions for Small to Medium Business

"proactive, professional, & to the Point" IT Solutions.

Share this post


Link to post
Share on other sites

Hello rogertvr / kgt,

 

I am also having the problem whereby I've set the max-use for a discount code but all customers paying via the paypal ipn mod have infinite goes at using the discount code.

 

I've set the auto return on etc. Did you resolve the problem that was occurring? Was there an error in the checkout.process.php file that was sent? If so, could you share this with me as I've run out of ideas.

 

Many Thanks,

 

James

Share this post


Link to post
Share on other sites

kgt, got a syntax error when installing the 'reports' code.

 

syntax error, unexpected ')' in /home/xxxxxx/public_html/catalog/admin/includes/boxes/reports.php on line 32

 

 

admin/includes/boxes/reports.php ----------------------------------------------

 

line 26

replace

 

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>');

 

with

 

//kgt - discount coupons report

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');

//end kgt - discount coupons report

 

 

Don't know if this has been visited already, but the fix for me is in BOLD below.

 

with

 

//kgt - discount coupons report

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a><br>' .

//end kgt - discount coupons report

 

 

Tom

Edited by dragon5

Share this post


Link to post
Share on other sites
Hi All,

 

I was wondering if anyone has expanded on this contribution to allow it to offer a coupon code that will offer free shipping and just drop the shipping charge when the coupon code is entered?

 

Any help is appriciated.

 

Regards,

Jp

This is exactly what I want. That is the main reason I want to offer special discounts at times. My shipping is based upon total of order so there is no specific discount I could give to all customers that would make the shipping 0.

Share this post


Link to post
Share on other sites

I am having a serious problem after installing this contribution. I hope that you guys can help me.

 

I am using paypal ipn, and when returning from the paypal payment page to checkout_process.php I get this error:

 

Parse error: syntax error, unexpected T_STRING in /home/shopdom/public_html/includes/languages/espanol/checkout_process.php on line 16

 

No confirmation email is sent and the shopping cart retains the paid items.

 

Any idea how to solve this? I will really appreciate it.

Share this post


Link to post
Share on other sites
Parse error: syntax error, unexpected T_STRING in /home/shopdom/public_html/includes/languages/espanol/checkout_process.php on line 16

 

You have a syntax error in includes/languages/espanol/checkout_process.php. Whatever changes you made to that file caused an error.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
kgt, got a syntax error when installing the 'reports' code.

 

syntax error, unexpected ')' in /home/xxxxxx/public_html/catalog/admin/includes/boxes/reports.php on line 32

admin/includes/boxes/reports.php ----------------------------------------------

 

line 26

replace

 

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a>');

 

with

 

//kgt - discount coupons report

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a>');

//end kgt - discount coupons report

Don't know if this has been visited already, but the fix for me is in BOLD below.

 

with

 

//kgt - discount coupons report

'<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_STATS_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_DISCOUNT_COUPONS . '</a><br>' .

//end kgt - discount coupons report

Tom

 

 

It's because you have another contribution installed.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
I was wondering if anyone has expanded on this contribution to allow it to offer a coupon code that will offer free shipping and just drop the shipping charge when the coupon code is entered?

 

The newest version will have this capability.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites
The newest version will have this capability.

When do you expect to have the new version ready as it seems that a lot of things will be improved.

I guess we can download it from contribution list page once it's ready?

Share this post


Link to post
Share on other sites
You have a syntax error in includes/languages/espanol/checkout_process.php. Whatever changes you made to that file caused an error.

Thank you very much!

 

I have found another problem: I am using paypal ipn and the discount although it shows in checkout_confirmation.php it is not being passed on to paypal. Any idea why?

Share this post


Link to post
Share on other sites
You have a syntax error in includes/languages/espanol/checkout_process.php. Whatever changes you made to that file caused an error.

Thank you very much!

 

I have found another problem: I am using paypal ipn and the discount although it shows in checkout_confirmation.php it is not being passed on to paypal. Any idea why?

Share this post


Link to post
Share on other sites
You have a syntax error in includes/languages/espanol/checkout_process.php. Whatever changes you made to that file caused an error.

Thank you very much!

 

I have found another problem: I am using paypal ipn and the discount although it shows in checkout_confirmation.php it is not being passed on to paypal. Any idea why?

Share this post


Link to post
Share on other sites
When do you expect to have the new version ready as it seems that a lot of things will be improved.

I guess we can download it from contribution list page once it's ready?

 

There should be some major improvements. It's mostly done, just needs to go through testing. If anyone is willing to help out with testing, please email or PM me.


Contributions

 

Discount Coupon Codes

Donations

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×