View Single Post
  #1  
Old 11-12-2009, 08:05 PM
 
ZFalcon ZFalcon is offline
 

Newbie
  
Join Date: Sep 2007
Posts: 8
 

Default Pulling my hair out ... Following Coupon Code

Hi All,

Going totally nuts here trying to customize my coupon to be on a different page. I have searched these forums and read every post that even has the word coupon in it, and while many mention this issue I'm having, not one has a solution. I am a relative novice at this and am doing my best to learn.

Where I am at in following the code and my question...

I have been able to move the location where it asks for a coupon code to just below the final pricing on the checkout page. This works flawlessly in calculating the coupon, but the problem is when a coupon is entered here it redirects to the incorrect page. This would seem pretty simple to fix, but for some reason it isn't in X-Cart.

When I try to "follow the code" I am able to see that {$paymentid} is set when the customer gets to the final checkout page with Fast Lane Checkout (the page labeled "Place Order" where it shows all the items, subtotal, shipping costs, billing address, shipping address, and requests the credit card info.)

Now when someone enters a coupon on that page and clicks submit, if it is a valid coupon it redirects them back one page to the "shipping and payment" page. If they leave the coupon blank entirely and submit, it takes them back to the very first page of "Your Shopping Cart". To clarify, I am referring to the submit with the coupon module (shop/skin1/modules/Discount_Coupons/add_coupon.tpl) not anything from any other element on the page.

I did add something to both the skin1/modules/Fast_Lane_Checkout for both checkout_2_method.tpl and checkout_3_place.tpl to show me the value of {$paymentid}. When someone first goes to the Shipping & Payment page that value is null. After selecting Delivery method and Payment method then clicking on continue, it goes to the checkout_3 page and shows the value of {$paymentid} as 1, which is correct based on my selection. It also shows the variable {$payment_data.paymentid} as the value of 1 at this point.

Here is where it gets even stranger. When a coupon is submitted, it "seems" to set both these values back to null and takes you back to the Shipping and
Payment page. That page shows these fields as null. If prior to entering the coupon I make a duplicate tab of the final page, then enter the coupon code, and go to the duplicate tab and refresh, it still shows {$paymentid} as 1 AND shows the coupon properly applied to the invoice.

If I were able to just get this thing to redirect to the place order page after a coupon is entered it would apparently fix the issue. I feel like a complete idiot that I can't follow the code enough to see where to put some kind of statement to have it go to the final Place Orders page after a coupon is entered.

One other thing that I tried is entering manually the url that the software appears to use to go to the place order page in the first place (see cart.php in the shop/modules/Fast_Lane_Checkout/ folder --- which is the file it uses to determine which page to go to at any time) www.mysite.com/shop/cart.php?paymentid=$paymentid&mode=checkout
this replies by taking me to the Shipping & Payment page with the URL of :
http://www.mysite.com/shop/cart.php?mode=checkout&err=paymentid

This specifically says that paymentid is the error.

What I then did was just replace the $paymentid with the number 1. This worked, but I have no clue where to even place this to force it to go back (and what variable to use instead of $paymentid since that seems to be the issue, that this is somehow, for some reason, set back to null somewhere in this whole process.) The link that works perfectly is : www.mysite.com/shop/cart.php?paymentid=1&mode=checkout

I tried changing the form action="cart.php" to form action="cart.php?paymentid=$paymentid&mode=checkou t" and no luck. I also tried the working line with the paymentid=1 in place of the variable and it still doesn't work.

Anyone - PLEASE help - I have spent over 9 hours total now fighting with something that really should be simple. How do I make the coupon on the last checkout page link back to the same page where the form was submitted?

*note: I did have to refresh the data from the server every time when I go to the place orders screen, so this doesn't appear to be a cache problem on my system.

Thanks in advance for any reply!
~David

P.S. I am on version 4.1
__________________
Version 4.0.16
Reply With Quote