Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Cart summary update problem - AJAX question??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-09-2014, 01:35 AM
 
Northcore Northcore is offline
 

Newbie
  
Join Date: Feb 2014
Posts: 9
 

Default 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/
Reply With Quote
  #2  
Old 11-09-2014, 05:13 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
Reply With Quote
  #3  
Old 11-09-2014, 10:16 AM
 
Northcore Northcore is offline
 

Newbie
  
Join Date: Feb 2014
Posts: 9
 

Default 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/
Reply With Quote
  #4  
Old 11-10-2014, 01:22 AM
 
Northcore Northcore is offline
 

Newbie
  
Join Date: Feb 2014
Posts: 9
 

Default 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/
Reply With Quote

The following user thanks Northcore for this useful post:
totaltec (11-10-2014)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:13 AM.

   

 
X-Cart forums © 2001-2020