Ziaur Rahman Posted November 16, 2016 Share Posted November 16, 2016 <p id="manufacturer" {if !$product_manufacturer->name}style="display: none;"{/if}> <label><b>{l s='Manufacturer:'} </b></label> <a href="{$link->getManufacturerLink($product_manufacturer->id_manufacturer, $product_manufacturer->link_rewrite)|escape:'html':'UTF-8'}"> <span>{$product->manufacturer_name|escape:'htmlall':'UTF-8'}</span> </a> </p> I have used above code for displaying manufacturer name with clickable link (not my own code). If any product has no manufacturer, product page auto hide for manufacturer row. Now I want to display supplier name as like as manufacturer name. Somebody can help me? Link to comment Share on other sites More sharing options...
Ziaur Rahman Posted November 17, 2016 Author Share Posted November 17, 2016 Need help Link to comment Share on other sites More sharing options...
danplant Posted December 11, 2016 Share Posted December 11, 2016 I am far too interested ! Link to comment Share on other sites More sharing options...
rocky Posted December 14, 2016 Share Posted December 14, 2016 You'll need to create override/controllers/front/ProductController.php with the following: <?php class ProductController extends ProductControllerCore { public function initContent() { parent::initContent(); if ((int)$this->product->id_supplier) { $this->context->smarty->assign( 'product_supplier', new Supplier((int)$this->product->id_supplier, (int)$this->context->language->id) ); } } } Remember to go to the Advanced Parameters > Performance tab and then click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. You can then add code like the following on the line before {if !$product->is_virtual && $product->condition} at about 163 of product.tpl: {if isset($product_supplier)} <p id="product_supplier"> <label>{l s='Supplier:'} </label> {$product_supplier->name} </p> {/if} 1 Link to comment Share on other sites More sharing options...
danplant Posted December 14, 2016 Share Posted December 14, 2016 GREAT ! Work !!!! Thanks a lot ! Link to comment Share on other sites More sharing options...
danplant Posted December 15, 2016 Share Posted December 15, 2016 One more "little" question: is possible to traslate the word: Supplier: to Fornitore: ? I tried to change: {if isset($product_supplier)} <p id="product_supplier"> <label>{l s='Supplier:'} </label> {$product_supplier->name} </p> {/if} to: {if isset($product_supplier)} <p id="product_supplier"> <label>{l s='Fornitore:'} </label> {$product_supplier->name} </p> {/if} but the output not change the word... Need to traslate throught Menu--->international--->Translations ? Link to comment Share on other sites More sharing options...
rocky Posted December 15, 2016 Share Posted December 15, 2016 Yes, translate it through Front Office translations and scroll down to the product section. Link to comment Share on other sites More sharing options...
danplant Posted December 16, 2016 Share Posted December 16, 2016 Thanks a lot, very helpful ! 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