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

Number of characters shown in product modify search

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-14-2003, 08:05 PM
  DogByteMan's Avatar 
DogByteMan DogByteMan is offline
 

X-Adept
  
Join Date: Mar 2003
Posts: 833
 

Default 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.
__________________
Dedicated Server provided by EWD Hosting
X-Cart version 4.1.12
PHP 5.3.2
MySQL server 5.0.87-community
Operation system Linux
Perl 5.008008
dogbytecomputer.com
Reply With Quote
  #2  
Old 11-17-2003, 04:55 PM
 
val@valcohen.com val@valcohen.com is offline
 

Newbie
  
Join Date: Sep 2003
Location: Long Beach, CA, USA
Posts: 6
 

Default

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...
__________________
X-Cart Gold 3.4.4; X-Affiliate 3.4.4; PHP 4.3.2; MySQL 4.0.15-standard; Apache 1.3.28; Red Hat Linux 7.1
Reply With Quote
  #3  
Old 12-31-2008, 08:33 AM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Default 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!
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
  #4  
Old 01-01-2009, 06:43 PM
 
Harry Harry is offline
 

Member
  
Join Date: May 2006
Posts: 13
 

Default 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.
__________________
Harry

X-Cart 4.1.8
PHP 4.4.4
MySQL server 4.1.22-standard
Web Server Apache/1.3.37
Operating System: Linux
Perl: 5.008008
xml: 1.95.6
Reply With Quote
  #5  
Old 01-07-2009, 05:49 PM
 
kmjperformance kmjperformance is offline
 

Advanced Member
  
Join Date: Jul 2008
Location: Iowa
Posts: 42
 

Default Re: Number of characters shown in product modify search

Figured it out!

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!
__________________

X-Cart 4.4.5
PHP 5.3.14-1
MySQL 5.0.51
Linux + Apache
Mods:
AlteredCart SmartSearch w/ AJAX Predictive Search w/ Extras Add-On v2, BuyTogether, Checkout One, OnSale
********* PowerFilter
WebsiteCM CDSEOPro
Phpmagicscripts Reviews-Controller
CFL Systems Products Page Layout, System Messages mod
Custom work by CFLSystems
Custom work by us
Reply With Quote
  #6  
Old 01-07-2009, 10:30 PM
  Vetrivel's Avatar 
Vetrivel Vetrivel is offline
 

eXpert
  
Join Date: Apr 2008
Posts: 398
 

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


Quote:
Originally Posted by kmjperformance
Figured it out!

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!
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 01:53 AM.

   

 
X-Cart forums © 2001-2020