Jump to content

[SOLVED] Supplier's address in supplier products' list


Recommended Posts

Hi,

 

You will need to change 2 files: SupplierController.php and supplier.tpl.

 

override/controllers/front/SupplierController.php

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:

<h2>{$supplier_address->address1|escape:'htmlall':'UTF-8'}</h2>

 

Regards

  • Like 2
Link to comment
Share on other sites

  • 10 months later...
  • 1 year later...

Hi, am not sure how to start my own topic but it must be similar to this, looking to add the manufacturers address. Yes, I have found where to add the address but when updating both the address section and the manufacturer list, I get informed when I click on the manufacturer that there is no address.Nor am I amble to choose any of the manufacturers when I want to add an address. So, perhaps this is really where the problem is. Am only able to work in back office because I am not accustomed to working with code. Can you help?

Link to comment
Share on other sites

×
×
  • Create New...