When coupon is entered, automatically goes to customer info page


  • Default avatar
    gui594    
     11 years ago
    0

    Hello, I am currently using the Pro AWO Coupon on my site www.taiffstore.com

    My problem is that when at the checkout page, and the customer enters the coupon code and clicks "Save", it takes them to a new page and asks them to fill out their customer information. And then it will proceed with a new page for each portion of the checkout (shipping, payment, etc) until you have finally done everything, and then it will take you back to the main checkout page with all of the information on it and you can finally see for the first time if the coupon code actually worked and what your total is. My shopping cart template is supposed to be a 1 page checkout where they can put in all of their information on the same page without having to go through multiple pages. As soon as a coupon code is entered, it forces them through various different pages before you can see if the coupon worked.

    Thank you in advance for your support!
  • Default avatar
    gui594    
     11 years ago
    0

    Basically, I need them to remain on the same page when they click the "Save" button to see how the coupon affected their cart.

    Thanks again.
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    From what you have described, and what I saw when viewing your page, you are not using a one page checkout, but a normal virtuemart checkout, which goes through multiple pages. You can disable the redirection after each step in virtuemart.
    In www/components/com_virtuemart/controllers/cart.php in function setcoupon around line 200 is this code
    <?php
        
    if ($cart->getInCheckOut()) {
            
    $app JFactory::getApplication();
            
    $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout'),$msg);
        } else {
            
    $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'),$msg);
        }
    ?>


    Comment out the redirection like this
    <?php
        
    if ($cart->getInCheckOut()) {
            
    $app JFactory::getApplication();
            
    //$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout'),$msg);
        
    } else {
            
    $app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart'),$msg);
        }
    ?>
  • Default avatar
    gui594    
     11 years ago
    0

    Thank you so much!

    I ended up commenting out that same line in like 4 different sections which was completely ruining my 1 page checkout. Solved the problem and then some. Much appreciated.
  • Default avatar
    elijah0    
     7 years ago
    0

    I am having this same issue with the latest version. When a user puts in the coupon on the cart page (before checkout) they get an invalid coupon and then a redirect to put in their address. Once the address is put in, the user can then add the coupon and it works fine. How do i make it so that the coupon works from the cart page or not show on the cart page at all?

  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Did you try the above solution?  It should work.