Jump to content

How to reload the quick-order page when the cart is modified?


Recommended Posts

Hi all,

I've an e-commerce with a single page checkout.

I've done some modifications to this page:  order-opc.tpl so that some text messages appears based on the presence or the absence of some products.

 

The problem is that these messages appear only when the page is reloaded.

When I remove a product from the cart the page is not reloaded and the messages are not refreshed.

 

How can I solve this problem according to you?

 

Thank you very much

 

claudio

Link to comment
Share on other sites

You can try adding the following script though header hook or add this code directly to you header.tpl

 




$(document).ajaxComplete(function(event, xhr, settings) {
    if (typeof (settings.data) != "undefined") {
        var data = settings.data.split('&');
        if (data[0] == 'controller=cart' && data[1] == 'ajax=true' && (data[2] == 'delete=true' || data[2] == 'add=true')) {
                location.reload();
        }
    }
});


 

  • Thanks 1
Link to comment
Share on other sites

Hi KnowBand,

thank you for your answer.

 

In the meantime I've resolved modifying the function processDeleteProductInCart in the CartController.php by adding at the end the line:

 $this->ajax_refresh = true;  to force the reload of the page.

 

Now I'll see your code because I've the same problem removing stuff from the ajax cart in the header of the site.

 

cld

Link to comment
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
×
×
  • Create New...