Last active
February 20, 2018 19:43
-
-
Save caovillanueva/1e96cb083ae3aed5a6cc9460cd982af4 to your computer and use it in GitHub Desktop.
PS1.7 Display manufacturer name on product page. ALTERNATIVE WAY:
{if isset($product_manufacturer->id)} <a class="PrManufName" href="{$product_brand_url}">{$product_manufacturer->name}</a> {/if}
***********************
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ProductController extends ProductControllerCore | |
{ | |
public function initContent(){ | |
$manufacturer_name = ""; | |
if($this->product->id_manufacturer > 0) | |
{ | |
$manufacturer = new Manufacturer($this->product->id_manufacturer, $this->context->language->id); | |
$manufacturer_name = $manufacturer->name; | |
} | |
$this->context->smarty->assign('manufacturer_name', $manufacturer_name); | |
parent::initContent(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Put the link wherever you want. | |
<a href="{$link->getManufacturerLink($product.id_manufacturer)}">{$manufacturer_name}</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment