X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How do you truncate product title... (https://forum.x-cart.com/showthread.php?t=20172)

Online Michael 02-26-2006 08:16 PM

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.

Jon 02-26-2006 09:22 PM

Change {$products[product].title}

to

{$products[product].product}

Online Michael 02-27-2006 12:31 AM

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.

Jon 02-27-2006 09:10 AM

Thanks for the kind words Michael :)

js33 04-07-2006 02:49 PM

Quote:

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

to

{$products[product].product}


Where do I find this line?

Thanks,
Joe

Jon 04-07-2006 03:14 PM

skin1/customer/main/products.tpl
skin1/customer/main/products_t.tpl

js33 04-09-2006 01:15 AM

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

ajj 04-09-2006 08:05 PM

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. :wink:

js33 04-09-2006 09:03 PM

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?

athenarchiver 05-17-2006 07:04 AM

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.)


All times are GMT -8. The time now is 10:53 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.