teo2586 Posted December 21, 2010 Share Posted December 21, 2010 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 More sharing options...
teo2586 Posted December 23, 2010 Author Share Posted December 23, 2010 nobody could help me??I need it!thanks. Link to comment Share on other sites More sharing options...
bobsmith Posted February 2, 2012 Share Posted February 2, 2012 anyone have any ideas? I'm also looking for this feature. Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 3, 2012 Share Posted February 3, 2012 Hello, Using the $manufacturer->id_address you need to create a new instance of the Address class, assign it to smarty and in the template file display the properties (city, address, postcode etc) Link to comment Share on other sites More sharing options...
bobsmith Posted February 6, 2012 Share Posted February 6, 2012 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 More sharing options...
shacker Posted February 6, 2012 Share Posted February 6, 2012 hi. We have free a module: extra manufacturer on our site this shows the manufacturer on product page. Maybe you can use to modify as you need Link to comment Share on other sites More sharing options...
bobsmith Posted February 6, 2012 Share Posted February 6, 2012 Hi thanks Shacker however I already have this feature setup on my site, just looking to show manufacturer address details somehow. Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 6, 2012 Share Posted February 6, 2012 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 More sharing options...
bobsmith Posted February 19, 2012 Share Posted February 19, 2012 Thanks for the response "assign the $address to smarty and edit manufacturer.tpl and display the desired informations about the address." how would i go about this? Link to comment Share on other sites More sharing options...
CartExpert.net Posted February 19, 2012 Share Posted February 19, 2012 Hello, $smarty->assign("my_var", $my_var) , that's how you assign the variable to smarty. To use the variable in a template: {$my_var} - if Integer, or any number type, or string {$my_var[0]} - array {$my_var.key_index} - if associative array {$my_var->property} - if object 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