We continue posting tricks to improve your Prestashop front- and back-office. This time I want to help you customize a List of products by supplier page.
For example, if you want supplier address to be displayed in the page, you will need to change 2 files: SupplierController.php and supplier.tpl.
override/controllers/front/SupplierController.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
class SupplierController extends SupplierControllerCore { protected function assignOne() { $nbProducts = $this->supplier->getProducts($this->supplier->id, null, null, null, $this->orderBy, $this->orderWay, true); $this->pagination((int)$nbProducts); $id_address = Address::getAddressIdBySupplierId($this->supplier->id); if ($id_address > 0) { $address = new Address((int)$id_address); } $this->context->smarty->assign(array( 'nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($this->supplier->id, $this->context->cookie->id_lang, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay), 'path' => ($this->supplier->active ? Tools::safeOutput($this->supplier->name) : ''), 'supplier' => $this->supplier, 'supplier_address' => $address, )); } } |
in themes/your_theme/supplier.tpl file insert the following code:
1 |
<h2>{$supplier_address->address1|escape:'htmlall':'UTF-8'}</h2> |
Partner With Us
Looking for a partner to grow your business? We are the right company to bring your webstore to success.
Talk to Igor
Bonjour,
Comment afficher tous les supplier d’un produit sur la page produit avec chacun son prix ?
Cdlt
Juan Antonio Pons,
Try this code:
Can you tell me how show phone supplier?. Ty