X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Coupon redirection issues (https://forum.x-cart.com/showthread.php?t=37765)

Chrisb 02-21-2008 04:26 PM

Coupon redirection issues
 
I have managed to move the coupon entry box to the final submit order page however when I type the coupon code in it redirects me to the previous page. How can I get it to stay on the current page?

The code to redirect to page after coupon has been entered from discount_coupon.php
if($my_coupon > 0) {
$cart["discount_coupon"] = "";
$cart["coupon_type"] = "";
$top_message['type'] = 'E';
}
func_header_location("cart.php?mode=checkout");
}
elseif ($mode=="unset_coupons") {
$cart["discount_coupon"]="";
$cart["coupon_type"] = "";
func_header_location("cart.php?mode=checkout");
}


The code I pasted into checkout.tpl to bring up coupon box

{if $cart.coupon_discount eq 0 and $products ne ""}
<p />
{if $active_modules.Discount_Coupons ne ""}
{include file="modules/Discount_Coupons/add_coupon.tpl}
{/if}
{/if}

balinor 02-21-2008 07:22 PM

Re: Coupon redirection issues
 
Look at what the url is on the last page of your checkout and put that in the header_location instead of cart.php?mode=checkout

Holub 02-22-2008 01:55 AM

Re: Coupon redirection issues
 
For example instead 'func_header_location("cart.php?mode=checkout");' in your code:

Code:

$cart['checkout_step']=4;
func_header_location("cart.php?mode=checkout&paymentid=4");


Note: You should to know paymentid of the selected payment method (if you have more than one payment method).

But this is another question...

Chrisb 02-24-2008 02:07 PM

Re: Coupon redirection issues
 
Hey guys thanks for the reply I have tried numerous header locations but none of them seem to work. I have tried:

("cart.php?mode=checkout&$paymentid")
("cart.php?mode=checkout&paymentid=4")
and more.
And the address in the address bar is http://easycoffee.com.au/cart.php which just bings me back to the start of the checkout process?

balinor 02-25-2008 04:23 AM

Re: Coupon redirection issues
 
Perhaps this won't work with Fast Lane

Chrisb 02-25-2008 12:11 PM

Re: Coupon redirection issues
 
That is what I am beginning to think :( All I need is the coupon to be on a page that is not skipped by the user. As it is when the user clicks on checkout they go straight past this point

Holub 02-27-2008 08:14 AM

Re: Coupon redirection issues
 
I've wrote "You should know paymentid of the selected payment method (if you have more than one payment method)."
Paymentid must be equal of selected by customer. Otherwise this will not work.
I've tested this at your site and I'm sure that this method working properly.
I've registered in your shop as Holub_from_forum. At 'Select payment method'checkout step I've selected 'Money Order' (from HTML source - paymentid=7). At last step I've returned to home.php and try to use url `http://easycoffee.com.au/cart.php?mode=checkout&paymentid=7` - and I was redirected to last checkout step 'Place order'.
Therefore, your shop should to `remember` selected paymentid and redirects customer to cart.php?mode=checkout&paymentid=(selected_payment _method_id)

Chrisb 03-02-2008 04:23 PM

Re: Coupon redirection issues
 
OK I see it does work when you enter the specific URL. But unfortunatelly as you said if you have multiple payment options this will not work. Is there a way to pass the payment ID into the URL depending on what is selected?


All times are GMT -8. The time now is 04:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.