Forums / Templates, Stylesheets, Page Layout / Can You Truncate Product Names?

Can You Truncate Product Names?

Locked

Views: 2,831

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
9 Aug 2007, 9:50 PM
#1
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Can You Truncate Product Names?

Hi everyone,

Is there a way to truncate the Product Names in the Product Listing only?

Basically, there are products with names that are 3 lines long. (columnar mode)

and i want them to all line up.

ie.. This Is The Prod...

Any ideas?

thanks in advance.

  • pensive612
10 Aug 2007, 7:23 AM
#2
lastpirate007 avatar

lastpirate007

Zen Follower

Join Date:
Jul 2007
Posts:
137
Plugin Contributions:
0

Re: Can You Truncate Product Names?

pensive612:

Hi everyone,

Is there a way to truncate the Product Names in the Product Listing only?

Basically, there are products with names that are 3 lines long. (columnar mode)

and i want them to all line up.

ie.. This Is The Prod...

Any ideas?

thanks in advance.

hi
you can customize in product listing section

admin>configuration>product listing

10 Aug 2007, 10:20 AM
#3
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

Thanks for the heads up lastpirate.

as far as i know, that is only to truncate the product description.

unfortunately what I need is to truncate the Product Name.

Unless, maybe i'm missing something else...

Any ideas?

thanks again.

  • pensive612
10 Aug 2007, 10:54 AM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can You Truncate Product Names?

No, I'm afraid that there's no way to truncate a product name, except by finding the code that generates them and changing it. If you wanted to do that there is a zzen_trunc_string function in functions_general that would make this easier. But otherwise Zen Cart has a built-in assumption that the product name is a name and not a mini-description.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

10 Aug 2007, 11:06 AM
#5
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

Thanks Kuroi. I had read about that truncate function before. and i had a feeling it would be the only way.

unfortunately, the client won't shorten the names. so i'll have to figure something out.

i'll post it if i find a solid fix...

as always Kuroi... your advice is very appreciated.

thanks.

  • pensive612
10 Aug 2007, 12:15 PM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can You Truncate Product Names?

Here's a bit more. You could go into the module file that is generating the layout specific page with the product names that you want to line up, and add a class to the <a> tag wrapper around the names. If you then use that class to display those links as blocks and give them a height > 3em, then although them wouldn't be the same length text-wise, they would all have the same vertical height. Might leave some odd looking gaps for the shorter ones though.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

10 Aug 2007, 7:17 PM
#7
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

Funny. That's pretty much what I did the other day. But it does add some awkward spacing.

Thanks again, Kuroi.

  • pensive612
10 Aug 2007, 7:21 PM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can You Truncate Product Names?

I'm afraid you can't shut me up today.

One way to deal with the awkward spacing would be to change the order of field so that the name comes last, that way everything lines up and the space "drops" off the end. This would work best if the images told enough of the story that the "names" could be supporting information rather than titles.

OK. That's it. I'll leave you space to work out your own solution now. :D

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

10 Aug 2007, 7:30 PM
#9
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

ha. bring it on any time...

i thought about that. but i think the title just needs to be under the image. although what your saying does make sense.

I'm gonna meet with the client today, and go over that idea too.

by the way, that office trader site you made is amazing.

did you add those extra product fields into the same table or a separate one?

I just did the exact same thing for this client.

i'm not even going to ask how you got them to be searchable fields....

good job!

  • pensive612
10 Aug 2007, 7:53 PM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Can You Truncate Product Names?

pensive612:

by the way, that office trader site you made is amazing.Thanks. A lot of work went into that, and there's still some more to go.

pensive612:

did you add those extra product fields into the same table or a separate one?

I just did the exact same thing for this client.

i'm not even going to ask how you got them to be searchable fields....They started as two extension tables to the products and products_description tables (plus lookup tables). But this made the queries more complex and I was worried about performance so brought them into the main tables.

That's actually a post that explains how the searches were done. But don't read it at the end of a long day. It makes my head spin and (at least in theory) I know how it was done.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

10 Aug 2007, 8:01 PM
#11
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

ha... but what makes your head spin. will make mine explode.

i'll check it out.

regardless great job.

thanks again for all your advice.

  • pensive612
6 Jan 2008, 6:06 AM
#12
lisk avatar

lisk

Zen Follower

Join Date:
Jun 2006
Posts:
118
Plugin Contributions:
0

Re: Can You Truncate Product Names?

I'd really like to be able to truncate product names automatically as well. I think half the title and "..." would make it more obvious that there's more to read on the product page, whereas right now I feel like some of my customers may think that all there is to see is the stuff on the categories page (b/c I have buy now buttons on the cat. pages). Got any more hints on using the truncate string function?

7 Jan 2008, 8:51 PM
#13
pensive612 avatar

pensive612

Zen Follower

Join Date:
May 2006
Posts:
313
Plugin Contributions:
0

Re: Can You Truncate Product Names?

Lisk,

Nice site and jewelry by the way.

It appears without serious customization, we are stuck with the length of the product names.

If I were you, I'd probably add a class to the product name in the featured products (i'm assuming that's where you want to do this). then just control the height with CSS. so they all line up evenly anyway.

i know its not a perfect solution. but i hope it helps...

  • pensive612
8 Nov 2008, 3:52 PM
#14
riseheadoffice avatar

riseheadoffice

New Zenner

Join Date:
Aug 2008
Posts:
13
Plugin Contributions:
0

Re: Can You Truncate Product Names?

i just want the product name truncated on the homepage. i.e new / featured / the catalogue.

basically becuase im displaying 24 products the names are colliding with each other

anyway to space out or change the way its displayed

I know you can truncate bestsellers but i just want the name truncated

or even just not shown.