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

How do you truncate product title...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-26-2006, 08:16 PM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default How do you truncate product title...

I hope someone here can help me with this little problem... I'm trying to remove the last 6 characters (the product id number) from the product title so instead of looking like this:

Galaxy Zone Sticker Pack #17822

it looks like this:

Galaxy Zone Sticker Pack

I think the code should go something like this:

{$products[product].title|truncate:60:"...":true}

But since the product title can vary in size, this solution is not acceptable. Is it possible to truncate the last 6 characters only? That way, the whole title appears (minus the id number) regardless of it's size.

Thanks.
__________________
X-Cart 5.3.5.4
Reply With Quote
  #2  
Old 02-26-2006, 09:22 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Change {$products[product].title}

to

{$products[product].product}
Reply With Quote
  #3  
Old 02-27-2006, 12:31 AM
 
Online Michael Online Michael is offline
 

eXpert
  
Join Date: Mar 2005
Location: Melbourne, Australia
Posts: 273
 

Default

Hello Jon, thanks for that info. Works great!. Also, and for the benefit of others, I tried to you use your code on a different page but it didnБ─≥t work so after some fiddling around I discovered {$product.product} got it to do what I wanted (not sure what the difference is though????). Anyway, thanks heaps.

Also Jon, since you so kindly took the time to help me out on this little problem of mine, I also wanted to tell you that your XNews mod is absolutely sensational! It's one of the few mods I've bought where the developer has really thought it through, from the users perspective, and put to market a 'complete' package. I'm really tired of those mods that do the bare minimum and get you to spend more money to get where it should have been in the first place. Well done to you and keep up the good work mate!

And to anyone else looking to buy mods for their cart, your first point of contact should be WebsiteCM.com ... great products from a great developer.
__________________
X-Cart 5.3.5.4
Reply With Quote
  #4  
Old 02-27-2006, 09:10 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Thanks for the kind words Michael
Reply With Quote
  #5  
Old 04-07-2006, 02:49 PM
 
js33 js33 is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 38
 

Default

Quote:
Originally Posted by Jon
Change {$products[product].title}

to

{$products[product].product}

Where do I find this line?

Thanks,
Joe
__________________
Version 4.0.18
Reply With Quote
  #6  
Old 04-07-2006, 03:14 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

skin1/customer/main/products.tpl
skin1/customer/main/products_t.tpl
Reply With Quote
  #7  
Old 04-09-2006, 01:15 AM
 
js33 js33 is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 38
 

Default

Thanks,

I changed it.

Why does Xcart start the productid at 16333?

Does it matter if this number doesn't coincide with the SKU numbers I'm using?

I'm becoming more familiar with the template system but man there are a lot of files to look at. Thankfully only some of them need to be edited.

Thanks,
Joe
__________________
Version 4.0.18
Reply With Quote
  #8  
Old 04-09-2006, 08:05 PM
 
ajj ajj is offline
 

Newbie
  
Join Date: Jan 2003
Posts: 7
 

Default

Quote:
Originally Posted by js33
Why does Xcart start the productid at 16333?

The productid is a auto_increment number in your sql database. Every time you add a Product this number increment. Nothing to worry about it has nothing todo with your sku.
__________________
Version 4.0.18
The fool wonders, the wise man asks.
Reply With Quote
  #9  
Old 04-09-2006, 09:03 PM
 
js33 js33 is offline
 

Advanced Member
  
Join Date: Apr 2006
Posts: 38
 

Default

Yeah but why does it start at 16333? Why not start at 1 like most counting systems do?

It says it is the productid not the index value?
__________________
Version 4.0.18
Reply With Quote
  #10  
Old 05-17-2006, 07:04 AM
 
athenarchiver athenarchiver is offline
 

Advanced Member
  
Join Date: May 2006
Posts: 31
 

Default x-config: SKU still there :O

I've successfully got rid of the SKU on all my products but since I've installed x-configurator I notice my configurable items have SKU's. I've looked in

modules/product_configurator/product.tpl
modules/product_configurator/products.tpl
modules/product_configurator/products_t.tpl

but don't find the above mentioned code. Anybody have a clue?

(Perhaps this should have been posted to another section but I thought it was relative to this post.)
__________________
X-cart 4.1.0
X-Configurator 4.1.0
PHP 4.4.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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:19 PM.

   

 
X-Cart forums © 2001-2020