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


PHP ProductSale::getNbSales方法代码示例

本文整理汇总了PHP中ProductSale::getNbSales方法的典型用法代码示例。如果您正苦于以下问题:PHP ProductSale::getNbSales方法的具体用法?PHP ProductSale::getNbSales怎么用?PHP ProductSale::getNbSales使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProductSale的用法示例。


在下文中一共展示了ProductSale::getNbSales方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initContent

 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::initContent();
         $this->productSort();
         $nb_products = (int) ProductSale::getNbSales();
         $this->pagination($nb_products);
         if (!Tools::getValue('orderby')) {
             $this->orderBy = 'sales';
         }
         $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
         $this->addColorsToProductList($products);
         /************************* /Images Array ******************************/
         if (method_exists('Product', 'getProductsImgs')) {
             $image_array = array();
             for ($i = 0; $i < $nb_products; $i++) {
                 if (isset($products[$i]['id_product'])) {
                     $image_array[$products[$i]['id_product']] = Product::getProductsImgs($products[$i]['id_product']);
                 }
             }
             $this->context->smarty->assign('productimg', (isset($image_array) and $image_array) ? $image_array : NULL);
         }
         /************************* /Images Array ******************************/
         $this->context->smarty->assign(array('products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nb_products, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
         $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:29,代码来源:BestSalesController.php

示例2: process

 public function process()
 {
     $this->productSort();
     $nbProducts = (int) ProductSale::getNbSales();
     $this->pagination($nbProducts);
     self::$smarty->assign(array('products' => ProductSale::getBestSales((int) self::$cookie->id_lang, (int) $this->p - 1, (int) $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home')));
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:7,代码来源:BestSalesController.php

示例3: initContent

 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = (int) ProductSale::getNbSales();
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home_default'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:9,代码来源:BestSalesController.php

示例4: initContent

 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::initContent();
         $this->productSort();
         $nbProducts = (int) ProductSale::getNbSales();
         $this->pagination($nbProducts);
         $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
         $this->addColorsToProductList($products);
         $this->context->smarty->assign(array('products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
         $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:15,代码来源:BestSalesController.php

示例5: initContent

 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::initContent();
         $this->productSort();
         $nbProducts = (int) ProductSale::getNbSales();
         $this->pagination($nbProducts);
         $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
         $this->addColorsToProductList($products);
         $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displayLeftColumn'), 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
         if ($this->ajax) {
             $product_list = $this->context->smarty->fetch(_PS_THEME_DIR_ . 'product-list.tpl');
             $pagination = $this->context->smarty->fetch(_PS_THEME_DIR_ . 'pagination.tpl');
             $nbLeftProducts = $nbProducts - ($this->n * ($this->p - 1) + count($products));
             $nbLeftProductsPercentage = ($nbProducts - $nbLeftProducts) / $nbProducts * 100;
             echo Tools::jsonEncode(array('productList' => utf8_encode($product_list), 'pagination' => $pagination, 'nbRenderedProducts' => $nbProducts, 'nbLeftProducts' => $nbLeftProducts, 'nbLeftProductsPercentage' => $nbLeftProductsPercentage));
             die;
         } else {
             $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
         }
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
开发者ID:WhisperingTree,项目名称:etagerca,代码行数:24,代码来源:BestSalesController.php

示例6: dirname

<?php

include dirname(__FILE__) . '/config/config.inc.php';
include dirname(__FILE__) . '/header.php';
include dirname(__FILE__) . '/product-sort.php';
$nbProducts = intval(ProductSale::getNbSales());
include dirname(__FILE__) . '/pagination.php';
$smarty->assign(array('products' => ProductSale::getBestSales(intval($cookie->id_lang), intval($p) - 1, intval($n), $orderBy, $orderWay), 'nbProducts' => $nbProducts));
$smarty->display(_PS_THEME_DIR_ . 'best-sales.tpl');
include dirname(__FILE__) . '/footer.php';
开发者ID:Bruno-2M,项目名称:prestashop,代码行数:10,代码来源:best-sales.php


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