ballot Posted October 31, 2010 Share Posted October 31, 2010 static public function getManufacturers($getNbProducts = false, $id_lang = 0, $active = false, $p = false, $n = false) this function returns all manufacturers i need just 1 manufacturer detail that i know id of it is there a function/class or i cant see :/ Link to comment Share on other sites More sharing options...
rocky Posted November 1, 2010 Share Posted November 1, 2010 Just use: $manufacturer = new Manufacturer($id_manufacturer, $id_lang); Then you can access a variable like this: $manufacturer->name Link to comment Share on other sites More sharing options...
ballot Posted November 2, 2010 Author Share Posted November 2, 2010 in supplier.php if ($id = intval(Tools::getValue('id_'.$objectType))) { include(dirname(__FILE__).'/product-sort.php'); $object = new $className(intval($id), $cookie->id_lang); if (!Validate::isLoadedObject($object)) $errors[] = Tools::displayError('object does not exist'); else { /* rewrited url set */ if ($objectType == 'supplier') $rewrited_url = $link->getSupplierLink($object->id, $object->link_rewrite); elseif ($objectType == 'manufacturer') $rewrited_url = $link->getManufacturerLink($object->id, $object->link_rewrite); include(dirname(__FILE__).'/header.php'); $nbProducts = $object->getProducts($id, NULL, NULL, NULL, $orderBy, $orderWay, true); //$databok = call_user_func(array($className, 'get'.$className.'s'), false, intval($cookie->id_lang), true); include(dirname(__FILE__).'/pagination.php'); $smarty->assign(array( 'nb_products' => $nbProducts, 'products' => $object->getProducts($id, intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay), $objectType => $object)); } $smarty->assign(array( 'errors' => $errors, 'path' => Tools::safeOutput($object->name), 'id_lang' => intval($cookie->id_lang), )); $smarty->display(_PS_THEME_DIR_.$objectType.'.tpl'); } in manufacturer.tpl {include file=$tpl_dir./breadcrumb.tpl} {l s='List of products by manufacturer:'} {$manufacturer->name|escape:'htmlall':'UTF-8'} manufacturer.tpl used a variable as named as $manufacturer but i cant see it as defined in supplier.php ? Link to comment Share on other sites More sharing options...
ballot Posted November 2, 2010 Author Share Posted November 2, 2010 ah $objectType => $object));its $object it looks like for me prestashop wanted to hide it Link to comment Share on other sites More sharing options...
SonnyBoyII Posted September 7, 2011 Share Posted September 7, 2011 Hi, How can I get manufacturer's name in shopping-cart-product-line.tpl? I can call only manufacturers id {$product.id_manufacturer} .... Link to comment Share on other sites More sharing options...
kimmy018 Posted December 2, 2013 Share Posted December 2, 2013 Just use: $manufacturer = new Manufacturer($id_manufacturer, $id_lang); Then you can access a variable like this: $manufacturer->name hi rocky, I want to use this but how can I get its parameters e.g. $id_manufacturer? Thanks for your time! Link to comment Share on other sites More sharing options...
vekia Posted December 2, 2013 Share Posted December 2, 2013 where you want to use this code? everything depends on it. 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