| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Cart summary update problem - AJAX question?? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Cart summary update problem - AJAX question??
I've been a bit of butcher and in myskin/common_files/customer/head.tpl I've deleted everything in the line1 div (don't need the tabs/speedbar) and written a little cart summary using $minicart_total_items and $minicart_total_cost which also displays messages based on the amount in the cart and $store_country (e.g. spend ё10 more for free UK shipping).
Everything works except if I add a product to the cart the information doesn't get updated because that area of the page is not being refreshed. If I move to another page it catches up and is correct. If I change the Your Country it refreshes fine - this is the behaviour I need when a product is added. So how do I trigger a refresh of head.tpl or the .line1 div when an item is added to the cart? FYI I'm using the add to cart popup module but the behaviour is the same if I disable it. Any help would be great - the stores nearly finished but I don't know where to start on this.
__________________
Gold Plus 4.6.4 CD SEO Custom Module --------------- First go with X-Cart still under construction www.northcore-europe.com/northcore-shop/ |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Cart summary update problem - AJAX question??
If I remember correctly the ajax refresh happens based on a specific CSS class. You could either dig through the javascript and update the class name there, or wrap your minicart section in the appropriate class.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Cart summary update problem - AJAX question??
Thanks Mike. I did wonder if losing the structure of the tabs/speed bar was part of the issue. I'll try bringing the various divs back in tomorrow and see if I can get to the bottom of it.
__________________
Gold Plus 4.6.4 CD SEO Custom Module --------------- First go with X-Cart still under construction www.northcore-europe.com/northcore-shop/ |
|||||||
#4
|
|||||||
|
|||||||
Re: Cart summary update problem - AJAX question??
Yes I couldn't have got it more wrong! Thanks for the pointer Mike. Just in case it helps anyone:
1) I left out the reference to skin/common_files/js/ajax.minicart.js 2) I think the div structure needs to include: <div class="menu-minicart"> <div class="minicart"> your code </div> </div> 3) Finally I have moved my code into mincart_total.tpl which is important as when the refresh is called this is the file that's loaded in.
__________________
Gold Plus 4.6.4 CD SEO Custom Module --------------- First go with X-Cart still under construction www.northcore-europe.com/northcore-shop/ |
|||||||
|
|
|||
X-Cart forums © 2001-2020
|