Jump to content
kgt

[Contribution] Discount Coupon Codes

Recommended Posts

I said that because I did not know you have separate discount codes for the different price breaks. The way I had read the post I replied to was that you wanted the discount to change based on the dollar amount of the order - not that the customer would use different codes based on the dollar amount of their order.

 

What is the minimum order check doing currently? I don't believe I ever had problems with this function, so I'm not sure what the fix would be - but if I know the error you are getting I may be able to find a fix.

 

 

Hi All-

 

I've just edited the existing files and added the new ones by creating the necessary folders in the file manager; yet I do not see the module under Modules> Order Total. Please advise.

Share this post


Link to post
Share on other sites

I would be interested in a fix that works for this one as I've had this problem for over a year now. I had it correctly changing the shipping, but then if the customer does not re-enter their discount code it changes the shipping again and then they don't understand why their coupon isn't on their order or why it keeps telling them their shipping isn't right. I have had to turn this feature off and just put a message on the checkout confirmation page that if your discount changes your shipping it will be adjusted during processing. Thankfully we don't process the cards online, so we can make adjustments first.

 

 

Hi - I'm having a problem with the interaction between free shipping for orders over $75 and a 20% discount code. I have 3.34 installed. So let's say you have an order that's $92 dollars and someone tries to apply 20% off coupon, then it dumps them from checkout_payment back to checkout_shipping with it saying "Your calculated shipping charges have changed" and only ship method as free shipping, even though they no longer qualify for free shipping. and over and over and over again. please help. thanks! i have sort order in order total as subtotal, discount coupon, shipping, tax, total.


~Tracy
 

Share this post


Link to post
Share on other sites

OK so...I have installed the add-on and followed the instructions. I am getting an error when I try to set up a coupon however. I looked through the forum but I did not find an answer to the problem. I am pasting in the error message below.

 

"The requested URL /shop/admin/FILENAME_DISCOUNT_COUPONS was not found on this server."

 

I've checked my server and I have uploaded the three files from the admin folder on the addon: coupons.php, coupons_exclusions.php, stats_discount_coupons.php . Am I missing a file or do I need to change something in the code somewhere? No existing files were edited if that helps...

 

Thanks in advance!!

Share this post


Link to post
Share on other sites

I am wondering if there is any way to apply the coupon and reflect the discounted subtotal in the shopping cart, or wherever, before you put your credit card info. Some people might not like to add their credit card info to know the actual discounted subtotal.

 

Thanks!!

Ed

:blink:

 

 

Just wondering if this was ever done? Some shops have other forms of checkout, e.g. PayPal express, Google, or amazon checkout, which the customer would never see the screen to apply there discount/coupon code.Thanks in advance. :)

Share this post


Link to post
Share on other sites

What version of osC are you using? In my store the coupon is entered on the checkout_payment.php page and then the credit card number is actually entered on the checkout_confirmation.php page, which also shows you the Discount, Subtotal, Shipping and Total for the order.

 

I started with osC 2.2 ms2 060817 and then manually updated it according to the instructions on what's changed for rc2 - this moved the payment information from the payment page to the checkout page for security reasons.

 

Just wondering if this was ever done? Some shops have other forms of checkout, e.g. PayPal express, Google, or amazon checkout, which the customer would never see the screen to apply there discount/coupon code.Thanks in advance. :)


~Tracy
 

Share this post


Link to post
Share on other sites

Thank you, i've just managed to install this contribution, this is the first contribution i've propperly installed, lol.

There's just one thing tho:

The store page is:

http://www.smartarotaries.com/catalog/index.php and you can easily add products by clicking 'buy now' on the home page or 'view' then add to cart...

But when you go on the categories section e.g. http://www.smartarotaries.com/catalog/index.php/cPath/22 and click 'buy now' you get a 404 not found page. Any suggestions on how I can correct this?

Share this post


Link to post
Share on other sites

I'm trying to set Discount Coupon Codes up and it seems to not be working. The 'admin' side seems to be working correctly, but when I enter a code during a checkout, it jumps to the next screen without doing anything with the code.

 

I'm not sure what version of osCommerce I'm on, but it is not the most current. The mod is being installed from the most recent contribution, though. No issues installing, and the admin side seems to work fine.

 

To replicate the issue, I get the discount box on checkout_payment.php and enter DISCOUNT which should be an easy match for the defined, always-active test code of DISCOUNT I added through the admin page.

 

Upon clicking 'Continue' the normal checkout_confirmation.php appears with no discount show.

 

I did some additional troubleshooting. I added the statement 'echo $coupon;' to the kgt block so as to determine if the code is being passed correctly. It is, I believe, as the code is now on top of the page display.

 

I tried adding another echo statement for debugging after the ' if( tep_not_null( $coupon ) && is_object( $order->coupon ) ) { //if they have entered something in the coupon field

' but this does not display (even in the page source) so I'm thinking one of the two statements in the if statement are false. I checked these, and it looks like it is the 'is_object($order->Coupon)' that is coming up null.

 

Any suggestions?

Share this post


Link to post
Share on other sites

OK so...I have installed the add-on and followed the instructions. I am getting an error when I try to set up a coupon however. I looked through the forum but I did not find an answer to the problem. I am pasting in the error message below.

 

"The requested URL /shop/admin/FILENAME_DISCOUNT_COUPONS was not found on this server."

 

I've checked my server and I have uploaded the three files from the admin folder on the addon: coupons.php, coupons_exclusions.php, stats_discount_coupons.php . Am I missing a file or do I need to change something in the code somewhere? No existing files were edited if that helps...

 

Thanks in advance!!

 

Can anyone point me in a direction to fix this please?? Thanks...

Share this post


Link to post
Share on other sites

Jinxster3, it looks like you forgot to upload/modify the /includes/filenames.php file as needed... You should need to add a few lines of code to that file from the documentation.

Share this post


Link to post
Share on other sites

My first guess would be to check the code on your catalog/index.php page as this page contains the category display information. You may have an "included" page in your category info on this page as well. Double check the category code and any included pages in that section of code against the install files to see if you've missed anything :)

 

Thank you, i've just managed to install this contribution, this is the first contribution i've propperly installed, lol.

There's just one thing tho:

The store page is:

http://www.smartarotaries.com/catalog/index.php and you can easily add products by clicking 'buy now' on the home page or 'view' then add to cart...

But when you go on the categories section e.g. http://www.smartarotaries.com/catalog/index.php/cPath/22 and click 'buy now' you get a 404 not found page. Any suggestions on how I can correct this?


~Tracy
 

Share this post


Link to post
Share on other sites

I downloaded the version posted on 9 July 2009, and am running version 2.2 RC 2 of osCommerce. When I attempt to go to catalog > discount coupons to create a discount, I get "500 Internal Server Error." I have apparently done something wrong, but I can't find my error. Has anyone else experienced this? Is my mistake obvious to someone more knowledgible than I am? Help!

Share this post


Link to post
Share on other sites

Hmm- it's hard to say exactly where the problem is - did you try using a file comparison tool (like WinMerge or a similar software) to compare the install files with your store files? Sometimes it's just a missed } or ; or ) type thing that causes the 500 errors.

 

You could also do a google search like this:

site:forums.oscommerce.com "Discount Coupon Codes" +"500 Internal Server Error"

 

That would pull up any other posts with those two phrases in them on the forums ;)

 

I downloaded the version posted on 9 July 2009, and am running version 2.2 RC 2 of osCommerce. When I attempt to go to catalog > discount coupons to create a discount, I get "500 Internal Server Error." I have apparently done something wrong, but I can't find my error. Has anyone else experienced this? Is my mistake obvious to someone more knowledgible than I am? Help!


~Tracy
 

Share this post


Link to post
Share on other sites

I have a problem with using this with purchase without account contribution

 

it does not calculate the discount what shall i do to make it work?

Share this post


Link to post
Share on other sites

I would try a google search to see if anyone else has posted about this, maybe try entering this at google

 

site:forums.oscommerce.com "Discount Coupon Code" +"Purchase without account"

 

I have a problem with using this with purchase without account contribution

 

it does not calculate the discount what shall i do to make it work?


~Tracy
 

Share this post


Link to post
Share on other sites

Hmm- it's hard to say exactly where the problem is - did you try using a file comparison tool (like WinMerge or a similar software) to compare the install files with your store files? Sometimes it's just a missed } or ; or ) type thing that causes the 500 errors.

 

You could also do a google search like this:

site:forums.oscommerce.com "Discount Coupon Codes" +"500 Internal Server Error"

 

That would pull up any other posts with those two phrases in them on the forums ;)

 

I ran the search but the only result was your post. I am not very knowledgible about website design and I have never even heard of file comparison tools, unfortunately. I have been able to resolve all of my other questions and have a working online store, but I'm stumped on this one.

Share this post


Link to post
Share on other sites

I ran the search but the only result was your post. I am not very knowledgible about website design and I have never even heard of file comparison tools, unfortunately. I have been able to resolve all of my other questions and have a working online store, but I'm stumped on this one.

 

I hate when I just find my own posts - LOL I would say go download winmerge (it is free) and compare the files, particularly the ones that are supposed to load the page that is giving the 500 error. Win Merge does a lot of the hard work for you - showing you the original file on one side and your file on the other (of course, you have to tell it where the files are located) and then highlighting any differences between the two. It's the only way I know of to resolve the 500 errors as they are typically just an error in the PHP script.


~Tracy
 

Share this post


Link to post
Share on other sites

Hi.

 

I have created a free shipping coupon.

 

But I have encountered an error when proceed to checkout confirmation page.

 

Here is the billing information:

 

Discount Coupon freeship123 applied: -$8.14

Sub-Total: $177.38

Table Rate (Australia Post - Express Post + Handling): $8.95

GST: $16.94

Total: $178.19

 

How do I include tax for the free shipping coupon? The shipping rate displayed here is without tax. It should be $8.95.

 

Please advice me on this issue.

 

Thanks a lot.

Share this post


Link to post
Share on other sites

I had found a shortcoming in the contribution that I have since fixed, but was wondering if anyone has a better fix for this.

The issue: I use multiple table rates (but the problem would apply to anyone using any combination of more than one shipping module. Basically if I offer a 100% off shipping discount the customer could select my UPS Ground Table rate or my UPS Overnight w/Saturday Table rate and it would still be 100% off. Obviously I don't want to give away, such an expensive delivery service. I solved the problem (code to follow) by putting a check in place right before the HTML is output to the checkout_confirmation.php page. The check first verifies if a code was entered then checks the code to see if it is shipping, if so it checks the the amount to see if it is 1.0 (100% or FREE) when this is the case it checks the shipping method, if the shipping method is not UPS Ground then it sends the user back to the checkout_shipping.php page with a message that the coupon code is only valid for UPS Ground. This gets the job done, but the code needs to be modified in two area for every site it is installed on. Not very many sites are using a Table rate called UPS Ground, so each site admin would have to adjust the shipping method to look for and also the site admin might not want limit only FREE shipping discounts to the least expensive shipping method, but perhaps any shipping discount over 40% or 75% or whatever. On the bright side the code that follows is very simple and easily edited to your taste, with minimal PHP skills.

This code goes just above the HTML portion of the checkout_confirmation.php page.

// if coupon code is for free shipping ensure user selected UPS Ground shipping service
 if (!(empty($coupon))){ //Only do this if a coupon code was entered
   // Get the coupon info from the db.
   $coupon_info_query = tep_db_query("SELECT * FROM discount_coupons WHERE coupons_id = '".$coupon."'"); 
if(mysql_num_rows($coupon_info_query) > 0){
	$coupon_info = tep_db_fetch_array($coupon_info_query);
               if($coupon_info['coupons_discount_type'] == 'shipping' && (int)$coupon_info['coupons_discount_amount'] == 1 && $order->info['shipping_method'] !== 'UPS Ground (UPS Ground)'){  
	        // Redirect only if the coupon is a FREE shipping and UPS Ground is not the selected shipping method
		tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING.'?sc=1', '', 'SSL'));	
	}		
}
 }

This code goes just inside the body tag of the checkout_shipping.php page and generates the message to the customer. Alternatively the message stack could be used or you could place the notice somewhere else.

<?php
if($_GET['sc']==1) echo '<h3 style="background-color:red;color:white;width:100%;">That coupon code is only valid for UPS Ground</h3>';
?>

I would love to see someone universalize this so it could be added to the contribution. Perhaps the the threshold for the shipping discount and allowable shipping method should be stored in the db and controlled from the admin panel. It would certain simplify the administration for non coders, but would also add some unnecessary db queries. I look forward to your thoughts.


I run a completely customized osC2.2 RC1 shop with mostly custom modifications that replicate the features of many contributions available except in a way that the data is more easily synced with Quickbooks on a continuous basis.

Share this post


Link to post
Share on other sites
I hate when I just find my own posts - LOL I would say go download winmerge (it is free) and compare the files, particularly the ones that are supposed to load the page that is giving the 500 error. Win Merge does a lot of the hard work for you - showing you the original file on one side and your file on the other (of course, you have to tell it where the files are located) and then highlighting any differences between the two. It's the only way I know of to resolve the 500 errors as they are typically just an error in the PHP script.

 

Okay ... I don't know what I would be comparing. There were several files that had to be manually edited, and I can only assume I made an error in one of those, but I can't find it. Since the files have been edited, what am I comparing them to?

 

Another thing I have realized is that there is a file "installer.sql" that was part of the download, but there is no mention of it in the instructions. What should I have done with that file?

 

Thanks.

Share this post


Link to post
Share on other sites

Hi.

 

I have a problem with paypal standard payment.

 

I have created a free shipping coupon. However, the information on Paypal payment page wasn't correct.

 

Item total: $17.53

Sales tax: $3.46

Shipping and handling: $8.95

Total with postage: $29.94 AUD

 

Below is the Payment payment page when not using free shipping coupon.

 

Item total: $25.67

Sales tax: $3.46

Shipping and handling: $8.95

Total with postage: $38.08 AUD

 

So, when applying free shipping coupon, the item total should be $25.67, and shipping and handling should be zero.

 

Is there anyone can help me with this issue.

 

 

Moreover, is there anyway to include tax for the free shipping coupon?

 

Below is the billing information

 

Discount Coupon freeship123 applied: -$8.14

Sub-Total: $29.13

Table Rate (Australia Post - Express Post + Handling): $8.95

GST: $3.46

Total: $29.94

 

How do I include tax for the free shipping coupon? The shipping rate displayed here is without tax. It should be $8.95.

 

Please I need helps!

Share this post


Link to post
Share on other sites

I installed the code right, but the box does not appear in checkout_payment.php , which may have occurred?

 

Thank's

Share this post


Link to post
Share on other sites

So what is the difference between this and the old but updated Credit Class & Gift Voucher? Reinventing of the wheel? Duplicated effort? Non efficient processes? (not the software ... people making the software)

 

Thanks!

Share this post


Link to post
Share on other sites

I'm not sure if anybody has posted about this yet, but there are problems in getting version 3.34 to work with version 1.1 of One Page Checkout. Does anybody know how to fix it?

 

This is what it's saying on the onepage_checkout.php page:

 

Fatal error: Call to undefined method stdClass::calculate_discount()

 

Thanks.

Share this post


Link to post
Share on other sites

Hi!

 

I am not a programmer but I am making my own site by using add-ons.

 

I installed the DCC ver 3.34. I followed the steps as best as i could and everything seems working fine until i tested the discount coupon.

In my checkout_confirmation page, i found out that my sub-total is doubling.

 

For example, subtotal is 850.00 for one item, it will show 1,700. then from there, the discount will be computed so my total is not correct.

i tried to search for answer but i really cant find one so im posting my problem here.

 

hope somebody can help me with this one.

 

thanks

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

×