Jump to content

show manufacturer address


teo2586

Recommended Posts

dear All,

I would like to show manufacturer address in Manufacturer.php page.
I've tried some ways but I cannot display them.
I can display id_address with {$manufacturer->id_address} but all other informations not.
I don't know what I have to modify in classes/manufacturer.php page.
Someone could help me?

thank you.

Link to comment
Share on other sites

  • 1 year later...

Thanks for the reply.

I don't suppose you'd be able to give me more info on what needs to be done.

 

"new instance of the Address class, assign it to smarty"

 

Which files to edit? I've tried a few things but no success.

 

any help is much appreciated.

Link to comment
Share on other sites

Hello,

 

Edit ManufacturerController.php.

 

If you want the address to be displayed on the product list of the manufacturer:

if (Validate::isLoadedObject($this->manufacturer) AND $this->manufacturer->active)
 {

 

after this line in the process() method create a new Address instance:

 

$address = new Address($manufacturer->id_address,(int)self::$cookie->id_lang));

 

, assign the $address to smarty and edit manufacturer.tpl and display the desired informations about the address.

 

 

If you want to display the address of the manufacturers in the manufacturer list

change:

foreach ($manufacturers AS &$row)
 $row['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$row['id_manufacturer'].'-medium.jpg')) ? Language::getIsoById((int)self::$cookie->id_lang).'-default' : $row['id_manufacturer'];

 

to

 

foreach ($manufacturers AS &$row)
{
 $row['image'] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$row['id_manufacturer'].'-medium.jpg')) ? Language::getIsoById((int)self::$cookie->id_lang).'-default' : $row['id_manufacturer'];
$row['address'] = new Address($row['id_address'], (int)self::$cookie->id_lang));
}

 

, edit manufacturer_list.tpl and display the desired informations about the address.

Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...