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)
-   -   Number of characters shown in product modify search (https://forum.x-cart.com/showthread.php?t=5232)

DogByteMan 11-14-2003 08:05 PM

Number of characters shown in product modify search
 
OK I'm sure I'm just missing it BUT...

Where can I find where I can edit the number of characters displayed for product search results in the product modify area.

val@valcohen.com 11-17-2003 04:55 PM

Not sure what you mean by "product modify area", but here's how to change the amount returned in the product description.

In WebMaster mode, do a product search and then, when viewing the search results page, use the debug panel to edit
'/customer/main/products.tpl'

Look for
{$products[product].descr|truncate:400:"...":true}

Change the value next to the 'truncate' keyword -- the '400' is the number of characters to print before truncating and then appending the string in quotes (this string is counted in the number of chars to truncate -- in this case, it's three chars). 'true' means truncate at the exact character; 'false' would tell Smarty to truncate at the last word boundary before the limit. Full docs at http://smarty.php.net/manual/en/language.modifier.truncate.php.

(Dunno if the limit is 400 chars in X-Cart by default -- it's that way on mine, but I've customized pretty heavily.)

Note that the search results page uses the SAME products template -- '/customer/main/products.tpl' -- that's used elsewhere to display multiple products, like in the category listings. So if you want to display different amounts of text depending on which page is displaying product info, you'll need to make further modifications. Depending on how different you want the output to look, you could:

- insert some conditional logic in products.tpl to vary the 'truncate' vlue depending on the current page. Better if you're only changing the amount of text, and the rest of the layout should be the same.

- duplicate 'products.tpl' into a new template, and call the new template instead of products.tpl in 'customer/main/search_result.tpl'. Better for more radical changes in layout. But now you have two templates to maintain.

HTH...

kmjperformance 12-31-2008 08:33 AM

Re: Number of characters shown in product modify search
 
I'm not sure if anyone is still reading this thread, but I also want to increase the number of characters shown for my search products page on the admin side. It currently only displays 30chrs for the product title (PRODUCT), but there is plenty of room on the screen for the entire title or at least around 100chrs. I looked into the instructions on this thread, and that doesn't help me with the product title, only the short description on the customer side.



Also, how would one go about adding extra columns to the search results page on the admin side only, like perhaps, WEIGHT and AVAIL.

Thanks in advance for any help!

Harry 01-01-2009 06:43 PM

Re: Number of characters shown in product modify search
 
I need to this too, it is too short, sometimes i have to open up the page to find out what the product title is.

kmjperformance 01-07-2009 05:49 PM

Re: Number of characters shown in product modify search
 
Figured it out!:D/

In Products.tpl search for...(I think it's about half way down)

Code:


<td width="100%">{if $products[prod].main eq "Y" or $main ne "category_products"}<b>{/if}<a href="product_modify.php?productid={$products[prod].productid}{if $navpage}&amp;page={$navpage}{/if}">{$products[prod].product|truncate:128:"...":false}</a>{if $products[prod].main eq "Y" or $main ne "category_products"}</b>{/if}</td>


I forgot what the original length was, but change the bold-red number to whatever you want it truncated to. I chose 128 because I'm pretty sure none of my product titles are longer than that.

Hope this helps!

Vetrivel 01-07-2009 10:30 PM

Re: Number of characters shown in product modify search
 
Yeap.Thats right.
the file is in skin1/main/products.tpl
and its original length is 35 {$products[prod].product|truncate:35:"...":false}
Note to kmjperformance:please mentioned the path while posting because products.tpl is present in both place(customer/main/products.tpl and skin1/main/products.tpl).So that it will easy for others to work out.:roll::roll::roll:


Quote:

Originally Posted by kmjperformance
Figured it out!:D/

In Products.tpl search for...(I think it's about half way down)

Code:


<td width="100%">{if $products[prod].main eq "Y" or $main ne "category_products"}<b>{/if}<a href="product_modify.php?productid={$products[prod].productid}{if $navpage}&amp;page={$navpage}{/if}">{$products[prod].product|truncate:128:"...":false}</a>{if $products[prod].main eq "Y" or $main ne "category_products"}</b>{/if}</td>


I forgot what the original length was, but change the bold-red number to whatever you want it truncated to. I chose 128 because I'm pretty sure none of my product titles are longer than that.

Hope this helps!



All times are GMT -8. The time now is 02:37 PM.

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