当前位置: 首页>>代码示例>>PHP>>正文


PHP Manufacturer::getProducts方法代码示例

本文整理汇总了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)));
 }
开发者ID:nmardones,项目名称:PrestaShop,代码行数:12,代码来源:ManufacturerController.php

示例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));
     }
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:33,代码来源:productsmanufacturer.php

示例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);
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:18,代码来源:ProductController_20aug_bkp.php


注:本文中的Manufacturer::getProducts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。