Jump to content

Ajax cart not showing some product names until page refresh


Recommended Posts

I am running version 1.5.6.1 with the default theme.

 

When you add a product to the cart (using the "Add to Basket" button on the categories page and view it in the block at the top right, some of them only show ... rather than the product name until a page refresh is done. Other products show up OK straight away.

 

I have attached a file with some screenshots showing the different behaviours.

 

The shop is not fully operational yet, but can be seen at "shop dot martelldesigns dot co dot uk".

 

Cart.doc

Link to comment
Share on other sites

 Sorry, can you see these? The descriptions of the images are below and correspond to the file numbers.

 

1.Spiral added, page not refreshed

2.As above, but after page refresh.

3.Cross added, page not refreshed. Does not show up.

4.Still no page refresh, but star added and it shows up, but cross does not.

post-751777-0-25672700-1390822619_thumb.png

post-751777-0-21219900-1390822623_thumb.png

post-751777-0-53090500-1390822625_thumb.png

post-751777-0-96761400-1390822628_thumb.png

Link to comment
Share on other sites

The topic there is talking about something slightly different - they want to edit the length before it truncates it whereas I am using the values as set and get the problem that when the name is >12 characters, the first time it shows the list in the cart, it just has "..." as in the pictures. They also refer to blockcart2 which does not appear in my module list (either under modules or theme/default/modules

 

However, referring to the posts there, I see that the corresponding line of code in ajax-cart.js that I have is 

 

var min = this.name.indexOf(';', 10);

var name = (this.name.length > 12 ? this.name.substring(0, ((min - 10) <= 7) ? min : 10) + '...' : this.name); 
 
whereas Izraelviz says that line 434 is
var name = (this.name.length > 12 ? this.name.substring(0, 10) + '...' : this.name); so I have tried changing it to that and it works. Not sure why this should be, but I will go with that for now.
Link to comment
Share on other sites

×
×
  • Create New...