Jump to content

Product name truncate in block-cart?


Recommended Posts

Hi,

I have enlarged the cart block somewhat.

I have edited the truncate command in blockcart.tpl to

{$product.name|truncate:30:'...'|escape:html:'UTF-8'}

 

When adding a product to the cart, the title of the product seems to be truncated.

Yet after refreshing the page, the full title is show and not truncated.

 

Where do I have to edit to show the product name in full on adding the product (before refreshing the page)

 

Link is in my sig

 

Thanks

Link to comment
Share on other sites

also in blockcart-json.tpl i have changed

 

"name":          "{$product.name|html_entity_decode:2:'UTF-8'|escape:'htmlall'|truncate:30:'...':true}",

 

and forced a refresh. But the product name is still truncated untill a refresh :(

Link to comment
Share on other sites

Here is what I mean....
I added the top product and refreshed.
The 2nd product I added but havent yet refreshed.

The 2nd product name is truncated, but if I refresh now then it is not truncated.

 

Ive tried in blockcart.js and blockcart-json.js but can figure it out :(

post-404663-0-74622000-1392905284_thumb.jpg

Link to comment
Share on other sites

  • 1 year later...

 Finally got it to work in PS 1.6 (full txt when add to cart) by changing in yourtheme/js/modules/blockcart/ajax-cart.js

 

 

the following with the desired length:

name = (name.length > 25 ? name.substring(0, 24) + '...' : name);

I precise this is if you want the product name to be displayed fully, or up to xx characters when added to cart without having to refresh

Edited by MilkSheikh (see edit history)
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...