Jump to content

Get Manufacturer detail by id?


Recommended Posts

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

in supplier.php

if ($id = intval(Tools::getValue('id_'.$objectType)))

   $object = new $className(intval($id), $cookie->id_lang);
   if (!Validate::isLoadedObject($object))
       $errors[] = Tools::displayError('object does not exist');
       /* 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);

       $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);
           'nb_products' => $nbProducts,
           'products' => $object->getProducts($id, intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay),
           $objectType => $object));

       'errors' => $errors,
       'path' => Tools::safeOutput($object->name),
       'id_lang' => intval($cookie->id_lang),


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

  • 10 months later...
  • 2 years later...

Just use:


$manufacturer = new Manufacturer($id_manufacturer, $id_lang);

Then you can access a variable like this:




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

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...