cerberus22 Posted April 24, 2009 Share Posted April 24, 2009 Hi all,how do I insert the suppliers name into the product list tpl ?I can insert the manufacturers name like this : {$product.manufacturer_name|truncate:35|escape:'htmlall':'UTF-8'} But how can I insert "suppliers" name as well ?Doing this does not work : {$product.supplier_name|truncate:35|escape:'htmlall':'UTF-8'} can anybody help ?All the best,Cerberus22UPDATE : this works : {$manufacturer.name|truncate:60|escape:'htmlall':'UTF-8'} Link to comment Share on other sites More sharing options...
Nakano Posted May 15, 2009 Share Posted May 15, 2009 Pardon my ignorance, but where exactly within the product list tpl should this line of code go? I mean, where and within which code tags should I use to place the manufacturer's name before Add to Cart button, for example. And what if we wanted the name displayed as a link to list all items from the same manufacturer?Thanks in advance! This should have been a default option in products' administration, btw... Link to comment Share on other sites More sharing options...
Bryan Lee Posted May 15, 2009 Share Posted May 15, 2009 Hi all,how do I insert the suppliers name into the product list tpl ?I can insert the manufacturers name like this :{$product.manufacturer_name|truncate:35|escape:'htmlall':'UTF-8'} But how can I insert "suppliers" name as well ?Doing this does not work : {$product.supplier_name|truncate:35|escape:'htmlall':'UTF-8'} can anybody help ?All the best,Cerberus22UPDATE : this works : {$manufacturer.name|truncate:60|escape:'htmlall':'UTF-8'} May be we have the same problem? http://www.prestashop.com/forums/viewthread/18986/installation_configuration___upgrade/how_can_config_the_block_sort_by_brandmanufactory Please visit and help me out. Many thanks Link to comment Share on other sites More sharing options...
rocky Posted May 15, 2009 Share Posted May 15, 2009 Hi Nakano,Add the following after line 19 of product-list.tpl in your theme directory (after the line that starts with ): {$product.manufacturer_name|truncate:60|escape:'htmlall':'UTF-8'} Then add the following line to /* product-list.tpl */ section of css/global.css in your theme directory: ul#product_list li span.manufacturer { display: block; } This will add a link to other products with the same manufacturer just above the Add to Cart button in product listings. Link to comment Share on other sites More sharing options...
Nakano Posted May 16, 2009 Share Posted May 16, 2009 Hi Rocky! Thanks a lot! It really helped to get something done, yes! So what was missing was a hack in the css file (dumb me! >_<).But then I noticed something really stupid from my post. Having the manufacturer's name listed in products list is nice, but what I wanted was this info displayed in product page itself. Taking in account the suggestions from both you and cerberus22 and this post, I managed to add the following code around line 234 of product.tpl, right before <!-- quantity wanted -->: {l s='Manufacturer:'} {$product_manufacturer->name|truncate:60|escape:'htmlall':'UTF-8'} Not sure how much having |truncate:60|escape:'htmlall':'UTF-8' really matters, but it ended up looking as I wished for.For the name to support a url link to all products from the same manufacturer, I did this (formated for easier reading here): <!-- manufacturer name --> {l s='Manufacturer:'} id_manufacturer}"> {$product_manufacturer->name|truncate:60|escape:'htmlall':'UTF-8'} It works! Please comment. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now