MrBaseball34 Posted May 13, 2010 Share Posted May 13, 2010 We have Part No. as one of the features. We'd like our search listings to show this feature as well as the manufacturer name, i.e.Here is how one part shows in the search results listing: 108V-14-Hex-Drill-and-Impact-Dri... 10.8 Volt 1/4" Hex Drill, Impact Driver and Light Kit Here is how it shows when you view the product: MAKLCT302W - Makita - 108V-14-Hex-Drill-and-Impact-Driver-Light-Kit We'd also like to provide the Part No and manufacturer in the list in the search results but I can't find a way to do that.The product.tpl has this code: {if $features.0.name eq "Part No."}{$features.0.value} -{/if} {$product_manufacturer->name|escape:'htmlall':'UTF-8'} - {$product->name|escape:'htmlall':'UTF-8'} The product-list.tpl has this code: {$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'} Now, when I place "similar" code in product-list.tpl: {if $product.features.0.name eq "Part No."}{$product.features.0.value} -{/if} {$product.manufacturer_name|escape:'htmlall':'UTF-8'} - {$product.name|escape:'htmlall':'UTF-8'} I get this: MAKLCT302W - Makita - 108V-14-Hex-Drill-and-Impact-Driver-Light-Kit I also want to truncate the value to 50 chars so it shows like this: MAKLCT302W - Makita - 108V-14-Hex-Drill-and-Imp... but I have been unable to do that.How would I concatenate the values into one variable and truncate it? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted May 13, 2010 Author Share Posted May 13, 2010 Even though I thought I already tried it with no success, capture works brilliantly, plus, I only had to truncate the product_name: {capture name=full_product} {if $product.features.0.name eq "Part No."}{$product.features.0.value|trim} - {/if} {$product.manufacturer_name|trim|escape:'htmlall':'UTF-8'} - {$product.name|truncate:30:'...'|escape:'htmlall':'UTF-8'} {/capture} {$smarty.capture.full_product} Link to comment Share on other sites More sharing options...
nikmagnus Posted January 10, 2011 Share Posted January 10, 2011 Thanks a lot, I have found this useful Link to comment Share on other sites More sharing options...
Recommended Posts