本文整理汇总了PHP中Manufacturer::getProducts方法的典型用法代码示例。如果您正苦于以下问题:PHP Manufacturer::getProducts方法的具体用法?PHP Manufacturer::getProducts怎么用?PHP Manufacturer::getProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manufacturer
的用法示例。
在下文中一共展示了Manufacturer::getProducts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assignOne
/**
* Assign template vars if displaying one manufacturer
*/
protected function assignOne()
{
$this->manufacturer->description = Tools::nl2br(trim($this->manufacturer->description));
$nbProducts = $this->manufacturer->getProducts($this->manufacturer->id, null, null, null, $this->orderBy, $this->orderWay, true);
$this->pagination((int) $nbProducts);
$products = $this->manufacturer->getProducts($this->manufacturer->id, $this->context->language->id, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay);
$this->addColorsToProductList($products);
$this->context->smarty->assign(array('nb_products' => $nbProducts, 'products' => $products, 'path' => $this->manufacturer->active ? Tools::safeOutput($this->manufacturer->name) : '', 'manufacturer' => $this->manufacturer, 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'body_classes' => array($this->php_self . '-' . $this->manufacturer->id, $this->php_self . '-' . $this->manufacturer->link_rewrite)));
}
示例2: hookProductFooter
public function hookProductFooter($params)
{
$id_product = (int) $params['product']->id;
$product = $params['product'];
if (isset($params['product']->id_manufacturer) && $params['product']->id_manufacturer) {
$cache_id = 'productsmanufacturer|' . $id_product . '|' . (int) $params['product']->id_manufacturer;
if (!$this->isCached('productsmanufacturer.tpl', $this->getCacheId($cache_id))) {
// Get infos
$manufacturer_products = Manufacturer::getProducts($params['product']->id_manufacturer, $this->context->language->id, 1, Configuration::get('pmslid_limit'));
/* 100 products max. */
// Remove current product from the list
if (is_array($manufacturer_products) && count($manufacturer_products)) {
foreach ($manufacturer_products as $key => $manufacturer_product) {
if ($manufacturer_product['id_product'] == $id_product) {
unset($manufacturer_products[$key]);
break;
}
}
$taxes = Product::getTaxCalculationMethod();
if (!Configuration::get('pmslid_DISPLAY_PRICE')) {
foreach ($manufacturer_products as $key => $manufacturer_product) {
if ($manufacturer_product['id_product'] != $id_product) {
$manufacturer_products[$key]['show_price'] = 0;
}
}
}
}
// Display tpl
$this->smarty->assign(array('manufacturer_products' => $manufacturer_products, 'ProdDisplayPrice' => Configuration::get('pmslid_DISPLAY_PRICE')));
}
return $this->display(__FILE__, 'productsmanufacturer.tpl', $this->getCacheId($cache_id));
}
}
示例3: getRandomBrandProducts
public function getRandomBrandProducts()
{
//see if the html fragment is in memcache
$memcache = new Memcache();
if ($memcache->connect('127.0.0.1', 11211)) {
$brandProducts = $memcache->get('product-brand-products-' . $this->product->id);
if ($brandProducts) {
return $brandProducts;
} else {
$brandProducts = Manufacturer::getProducts($this->product->id_manufacturer, (int) self::$cookie->id_lang, 0, 15, NULL, NULL, false, true, true, 15, false);
$memcache->set('product-brand-products-' . $this->product->id, $brandProducts, false, 172800);
//cache for 2 days
return $brandProducts;
}
} else {
return Manufacturer::getProducts($this->product->id_manufacturer, (int) self::$cookie->id_lang, 0, 15, NULL, NULL, false, true, true, 15, false);
}
}