本文整理汇总了PHP中Product::getPricesDrop方法的典型用法代码示例。如果您正苦于以下问题:PHP Product::getPricesDrop方法的具体用法?PHP Product::getPricesDrop怎么用?PHP Product::getPricesDrop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Product
的用法示例。
在下文中一共展示了Product::getPricesDrop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderContent
public function renderContent($setting)
{
$t = array('list_type' => '', 'limit' => 12, 'image_width' => '200', 'image_height' => '200');
$products = array();
$setting = array_merge($t, $setting);
switch ($setting['list_type']) {
case 'newest':
$products = Product::getNewProducts($this->lang_id, 0, (int) $setting['limit']);
break;
case 'featured':
$category = new Category(Context::getContext()->shop->getCategory(), $this->lang_id);
$nb = (int) $setting['limit'];
$products = $category->getProducts((int) $this->lang_id, 1, $nb ? $nb : 8);
break;
case 'bestseller':
$products = ProductSale::getBestSalesLight((int) $this->lang_id, 0, (int) $setting['limit']);
break;
case 'special':
$products = Product::getPricesDrop($this->lang_id, 0, (int) $setting['limit']);
break;
}
$setting['products'] = $products;
$output = array('type' => 'productlist', 'data' => $setting);
return $output;
}
示例2: renderContent
public function renderContent($setting)
{
$t = array('limit' => '6', 'columns' => 4, 'list_mode' => 'grid', 'display_mode' => 'carousel', 'nbr_desktops' => 4, 'nbr_tablets' => 2, 'nbr_mobile' => 1);
$setting = array_merge($t, $setting);
$nb = (int) $setting['limit'];
$porder = 'date add';
$porder = preg_split('#\\s+#', $porder);
$special = Product::getPricesDrop((int) $this->lang_id, 0, $nb, false);
if ($special) {
foreach ($special as &$row) {
$time = '';
if ($row['specific_prices']['to'] == '0000-00-00 00:00:00') {
$row['js'] = 'unlimited';
$row['finish'] = $this->l('Unlimited');
$row['check_status'] = 1;
$row['psdate'] = $this->l('Unlimited');
} else {
$time = strtotime($row['specific_prices']['to']);
$row['finish'] = $this->l('Expired');
$row['check_status'] = 1;
$row['psdate'] = $row['specific_prices']['to'];
}
if ($time) {
$row['js'] = array('month' => date('m', $time), 'day' => date('d', $time), 'year' => date('Y', $time), 'hour' => date('H', $time), 'minute' => date('i', $time), 'seconds' => date('s', $time));
}
}
}
$setting['list_mode_tpl'] = $this->getProductListStyleFile($setting['list_mode'], $setting['product_style']);
$setting['products'] = $special;
$output = array('type' => 'productdeal', 'data' => $setting);
return $output;
}
示例3: process
public function process()
{
parent::process();
$this->productSort();
$nbProducts = Product::getPricesDrop((int) self::$cookie->id_lang, NULL, NULL, true);
$this->pagination($nbProducts);
self::$smarty->assign(array('products' => Product::getPricesDrop((int) self::$cookie->id_lang, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home')));
}
示例4: initContent
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$this->productSort();
$nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
$this->pagination($nbProducts);
$this->context->smarty->assign(array('products' => Product::getPricesDrop($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), '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_ . 'prices-drop.tpl');
}
示例5: renderContent
public function renderContent($setting)
{
$t = array('end_date' => '', 'limit' => '12', 'image_width' => '200', 'image_height' => '200', 'columns' => 4, 'list_mode' => 'grid', 'display_mode' => 'carousel', 'nbr_desktops' => 4, 'nbr_tablets' => 2, 'nbr_mobile' => 1);
$setting = array_merge($t, $setting);
$time = strtotime($setting['end_date']);
$setting['dates'] = array('month' => date('m', $time), 'day' => date('d', $time), 'year' => date('Y', $time), 'hour' => date('H', $time), 'minute' => date('i', $time), 'seconds' => date('s', $time));
$nb = (int) $setting['limit'];
$special = Product::getPricesDrop((int) $this->lang_id, 0, $nb, false, null, null, false, $setting['end_date']);
$setting['list_mode_tpl'] = $this->getProductListStyleFile($setting['list_mode'], $setting['product_style']);
$setting['products'] = $special;
$output = array('type' => 'flashsale', 'data' => $setting);
return $output;
}
示例6: hookHome
public function hookHome($params)
{
if (Configuration::get('PS_CATALOG_MODE')) {
return;
}
global $smarty;
$tmp = Product::getPricesDrop(intval($params['cookie']->id_lang));
asort($tmp);
if (!($special = Product::getRandomSpecial((int) $params['cookie']->id_lang)) && !Configuration::get('PS_BLOCK_SPECIALS_DISPLAY')) {
return;
}
$this->smarty->assign(array('special' => $special, 'specials' => $tmp, 'priceWithoutReduction_tax_excl' => Tools::ps_round($special['price_without_reduction'], 2), 'mediumSize' => Image::getSize('medium_default')));
return $this->display(__FILE__, 'tmspecials.tpl');
}
示例7: renderContent
public function renderContent($args, $setting)
{
# validate module
unset($args);
$t = array('name' => '', 'html' => '');
$setting = array_merge($t, $setting);
$nb = $setting['itemstab'] ? (int) $setting['itemstab'] : 8;
$orderby = $setting['orderby'] ? $setting['orderby'] : 'date_add';
$orderway = $setting['orderway'] ? $setting['orderway'] : 'date_add';
$items_page = $columns_page = 3;
if (isset($setting['itemspage']) && $setting['itemspage']) {
$items_page = $setting['itemspage'];
}
if (isset($setting['columns']) && $setting['columns']) {
$columns_page = $setting['columns'];
}
$interval = isset($setting['interval']) ? (int) $setting['interval'] : 8000;
switch ($setting['specialtype']) {
case 'newest':
$products = Product::getNewProducts($this->langID, 0, $nb, false, $orderby, $orderway);
break;
case 'featured':
$category = new Category(Context::getContext()->shop->getCategory(), $this->langID);
$products = $category->getProducts((int) $this->langID, 1, $nb, $orderby, $orderway);
break;
case 'bestseller':
$products = ProductSale::getBestSalesLight((int) $this->langID, 0, $nb);
break;
case 'special':
$products = Product::getPricesDrop($this->langID, 0, $nb, false, $orderby, $orderway);
break;
case 'random':
$random = true;
$products = $this->getProducts('WHERE p.id_product > 0', (int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway, false, true, $random, $nb);
Configuration::updateValue('LEO_CURRENT_RANDOM_CACHE', '1');
break;
}
$setting['specialtype'] = $setting['specialtype'];
Context::getContext()->controller->addColorsToProductList($products);
$setting['products'] = $products;
$setting['itemsperpage'] = $items_page;
$setting['columnspage'] = $columns_page;
$setting['scolumn'] = 12 / $columns_page;
$setting['interval'] = $interval;
$setting['tab'] = 'leospecialproduct' . rand(20, rand());
$output = array('type' => 'specialproduct', 'data' => $setting);
return $output;
}
示例8: renderContent
public function renderContent($args, $setting)
{
# validate module
unset($args);
$t = array('name' => '', 'html' => '');
$setting = array_merge($t, $setting);
$setting['special'] = array();
$setting['bestseller'] = array();
$setting['featured'] = array();
$setting['newproducts'] = array();
$category = new Category(Context::getContext()->shop->getCategory(), (int) Context::getContext()->language->id);
$nb = $setting['itemstab'] ? (int) $setting['itemstab'] : 6;
$orderby = $setting['orderby'] ? $setting['orderby'] : 'position';
$orderway = $setting['orderway'] ? $setting['orderway'] : 'ASC';
$items_page = $setting['itemspage'] ? (int) $setting['itemspage'] : 3;
$columns_page = $setting['columns'] ? (int) $setting['columns'] : 3;
$interval = isset($setting['interval']) ? (int) $setting['interval'] : 8000;
if ($setting['featured_display'] && $setting['featured_display'] == 1) {
$pro_featured = $category->getProducts((int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway);
Context::getContext()->controller->addColorsToProductList($pro_featured);
$setting['featured'] = $pro_featured;
}
if ($setting['newarrivals_display'] && $setting['newarrivals_display'] == 1) {
$pro_newproducts = Product::getNewProducts((int) Context::getContext()->language->id, 0, $nb, false, $orderby, $orderway);
Context::getContext()->controller->addColorsToProductList($pro_newproducts);
$setting['newproducts'] = $pro_newproducts;
}
if ($setting['special_display'] && $setting['special_display'] == 1) {
$pro_special = Product::getPricesDrop((int) Context::getContext()->language->id, 0, $nb, false, $orderby, $orderway);
Context::getContext()->controller->addColorsToProductList($pro_special);
$setting['special'] = $pro_special;
}
if ($setting['bestseller_display'] && $setting['bestseller_display'] == 1) {
$pro_bestseller = ProductSale::getBestSales((int) Context::getContext()->language->id, 0, $nb, $orderby, $orderway);
Context::getContext()->controller->addColorsToProductList($pro_bestseller);
$setting['bestseller'] = $pro_bestseller;
}
$setting['itemsperpage'] = $items_page;
$setting['columnspage'] = $columns_page;
$setting['interval'] = $interval;
$setting['scolumn'] = 12 / $columns_page;
$setting['homeSize'] = Image::getSize(ImageType::getFormatedName('home'));
$setting['myTab'] = 'leoproducttab' . rand(20, rand());
$output = array('type' => 'producttabs', 'data' => $setting);
return $output;
}
示例9: _getProducts
/**
* Récupération de la liste des produits
* @param string $type
* @param int $nb_products
*/
protected function _getProducts($type, $nb_products)
{
switch ($type) {
case 'price_drop':
return Product::getPricesDrop((int) $this->context->language->id, 0, $nb_products);
break;
case 'category':
$this->_datas['id_category'] ? $id_category = $this->_datas['id_category'] : ($id_category = (int) Configuration::get('HOME_FEATURED_CAT'));
$category = new Category($id_category, (int) $this->context->language->id);
return $category->getProducts((int) $this->context->language->id, 1, $nb_products, 'position');
break;
case 'new':
default:
return Product::getNewProducts((int) $this->context->language->id, 0, $nb_products);
break;
}
}
示例10: initContent
public function initContent()
{
parent::initContent();
$this->productSort();
$nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
$this->pagination($nbProducts);
$products = Product::getPricesDrop($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay);
$this->addColorsToProductList($products);
if (method_exists('Product', 'getProductsImgs')) {
$image_array = array();
for ($i = 0; $i < $nbProducts; $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);
}
$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_ . 'prices-drop.tpl');
}
示例11: initContent
public function initContent()
{
parent::initContent();
$this->productSort();
$nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
$this->pagination($nbProducts);
$products = Product::getPricesDrop($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $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');
$pagination_bottom = $this->context->smarty->fetch(_PS_THEME_DIR_ . 'pagination_bottom.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, 'pagination_bottom' => $pagination_bottom, 'nbRenderedProducts' => $nbProducts, 'nbLeftProducts' => $nbLeftProducts, 'nbLeftProductsPercentage' => $nbLeftProductsPercentage));
die;
} else {
$this->setTemplate(_PS_THEME_DIR_ . 'prices-drop.tpl');
}
}
示例12: getData
/**
* get list of Sliders Data following parameter
*/
public function getData($params)
{
global $link, $cookie;
$nb = (int) $params->get("limit", 10);
switch ($params->get('psmode', 'featured')) {
case 'newest':
$products = Product::getNewProducts((int) $cookie->id_lang, 0, $nb);
break;
case 'special':
$products = Product::getPricesDrop($this->context->language->id, null, $nb, true);
break;
case 'featured':
default:
$category = new Category(Context::getContext()->shop->getCategory(), (int) Context::getContext()->language->id);
$products = $category->getProducts((int) Context::getContext()->language->id, 1, $nb);
break;
}
$iwidth = $params->get('imgwidth', 960);
$iheight = $params->get('imgheight', 360);
$twidth = $params->get('thumbwidth', 160);
$theight = $params->get('thumbheight', 90);
$output = array();
foreach ($products as $i => $product) {
$output[] = array('id_slide' => $product['id_product'], 'image' => $link->getImageLink($product["link_rewrite"], $product["id_image"]), 'title' => $product['name'], 'url' => $product['link'], 'oimage' => '', 'thumb' => '', 'legend' => '', 'description' => $product['description_short'], 'category' => $product['category'], 'price' => $product['price'], 'price_tax_exc' => $product['price_tax_exc'], 'attribute_price' => $product['attribute_price'], 'price_without_reduction' => $product['price_without_reduction'], 'manufacturer' => $product['manufacturer_nam']);
$output[$i]['thumbnail'] = $output[$i]['image'];
$output[$i]['mainimage'] = $output[$i]['image'];
if ($params->get('cropthumb', 1) && $output[$i]['image']) {
$output[$i]['mainimage'] = $this->renderThumb($output[$i]['image'], $iwidth, $iheight);
$output[$i]['thumbnail'] = $this->renderThumb($output[$i]['image'], $twidth, $theight);
}
// echo '<pre>'.print_r( $output, 1 ); die;
}
unset($products);
// echo '<pre>'.print_r( $output, 1 ); die;
return $output;
}
示例13: hookdisplayHome
public function hookdisplayHome($params)
{
$finish = Configuration::get('DEALS');
$deals_day = new DateTime($finish);
if (!$this->isCached('discountproducts_home.tpl', $this->getCacheId())) {
if (new DateTime(date("Y-m-d H:i:s")) < new DateTime($finish)) {
$id_lang = $this->context->language->id;
$nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
$products = Product::getPricesDrop($this->context->language->id, 0, $nbProducts, false, 'date_upd', 'asc');
$results = array();
foreach ($products as $product) {
if (isset($product['specific_prices']['to']) && $product['specific_prices']['to'] != '0000-00-00 00:00:00') {
$end_day = new DateTime($product['specific_prices']['to']);
if ($end_day == $deals_day) {
$results[] = $product;
}
}
}
$this->context->smarty->assign('products', $results);
} else {
$this->context->smarty->assign(array('expired_warning' => $this->l('Sorry! it\'s expired!'), 'products' => array()));
}
$end_day = array();
$str_date = explode(' ', $finish);
$str_day = explode('-', $str_date[0]);
$str_time = explode(':', $str_date[1]);
$end_day['y'] = $str_day[0];
$end_day['m'] = $str_day[1];
$end_day['d'] = $str_day[2];
$end_day['h'] = $str_time[0];
$end_day['i'] = $str_time[1];
$end_day['s'] = $str_time[2];
$this->context->smarty->assign(array('deals_day' => $end_day, 'expiryText' => 'End in ' . $finish));
}
return $this->display(__FILE__, 'discountproducts_home.tpl', $this->getCacheId());
}
示例14: buildSubmenuTree
public function buildSubmenuTree(array $dataset, $frontend = false, $cssgenerator = false)
{
$id_lang = (int) Context::getContext()->language->id;
$id_shop = (int) Context::getContext()->shop->id;
$id_lang_default = (int) Configuration::get('PS_LANG_DEFAULT');
$tree = array();
foreach ($dataset as $id => &$node) {
if ($cssgenerator) {
//set style
if (isset($node['content_s']['br_top_st'])) {
$node['content_s']['br_top_st'] = $this->convertBorderType($node['content_s']['br_top_st']);
}
if (isset($node['content_s']['br_right_st'])) {
$node['content_s']['br_right_st'] = $this->convertBorderType($node['content_s']['br_right_st']);
}
if (isset($node['content_s']['br_bottom_st'])) {
$node['content_s']['br_bottom_st'] = $this->convertBorderType($node['content_s']['br_bottom_st']);
}
if (isset($node['content_s']['br_left_st'])) {
$node['content_s']['br_left_st'] = $this->convertBorderType($node['content_s']['br_left_st']);
}
}
if ($frontend) {
if (isset($node['content_s']['title'][$id_lang]) && $node['content_s']['title'][$id_lang] != '') {
$node['content_s']['title'] = $node['content_s']['title'][$id_lang];
} elseif (isset($node['content_s']['title'][$id_lang_default]) && $node['content_s']['title'][$id_lang_default] != '') {
$node['content_s']['title'] = $node['content_s']['title'][$id_lang_default];
} else {
unset($node['content_s']['title']);
}
if (isset($node['content_s']['href'][$id_lang]) && $node['content_s']['href'][$id_lang] != '') {
$node['content_s']['href'] = $node['content_s']['href'][$id_lang];
} elseif (isset($node['content_s']['href'][$id_lang_default]) && $node['content_s']['href'][$id_lang_default] != '') {
$node['content_s']['href'] = $node['content_s']['href'][$id_lang_default];
} else {
unset($node['content_s']['href']);
}
if (isset($node['content_s']['legend'][$id_lang]) && $node['content_s']['legend'][$id_lang] != '') {
$node['content_s']['legend'] = $node['content_s']['legend'][$id_lang];
} elseif (isset($node['content_s']['legend'][$id_lang_default]) && $node['content_s']['legend'][$id_lang_default] != '') {
$node['content_s']['legend'] = $node['content_s']['legend'][$id_lang_default];
} else {
unset($node['content_s']['legend']);
}
if (isset($node['tabtitle'][$id_lang]) && $node['tabtitle'][$id_lang] != '') {
$node['tabtitle'] = $node['tabtitle'][$id_lang];
} elseif (isset($node['tabtitle'][$id_lang_default]) && $node['tabtitle'][$id_lang_default] != '') {
$node['tabtitle'] = $node['tabtitle'][$id_lang_default];
} else {
unset($node['tabtitle']);
}
//set variouse links
if (isset($node['contentType'])) {
switch ($node['contentType']) {
case 1:
if (isset($node['content']['ids'])) {
$customhtml = new IqitCreatorHtml((int) $node['content']['ids'], $id_lang);
if (Validate::isLoadedObject($customhtml)) {
$node['content']['ids'] = $customhtml->html;
}
}
break;
case 4:
if (isset($node['content']['ids']) && !empty($node['content']['ids'])) {
$node['content']['products'] = Product::getProductsProperties($id_lang, $this->getProducts($node['content']['ids']));
$products = $node['content']['products'];
$this->addColorsToProductList($node['content']['products']);
if (method_exists('Product', 'getProductsImgs')) {
$image_array = array();
for ($i = 0; $i < count($products); $i++) {
if (isset($products[$i]['id_product'])) {
$image_array[$products[$i]['id_product']] = Product::getProductsImgs($products[$i]['id_product']);
}
}
$node['content']['productsimg'] = (isset($image_array) and $image_array) ? $image_array : NULL;
}
if ($node['content']['view'] == 1 || $node['content']['view'] == 3) {
$node['content']['line_lg'] = $this->convertGridSizeValue($node['content']['line_lg']);
$node['content']['line_md'] = $this->convertGridSizeValue($node['content']['line_md']);
$node['content']['line_sm'] = $this->convertGridSizeValue($node['content']['line_sm']);
$node['content']['line_ms'] = $this->convertGridSizeValue($node['content']['line_ms']);
$node['content']['line_xs'] = $this->convertGridSizeValue($node['content']['line_xs']);
}
}
break;
case 2:
if (isset($node['content']['ids'])) {
if ($node['content']['ids'] == 'n') {
if ($node['content']['o'] == 1) {
$products = Product::getNewProducts($id_lang, 0, (int) $node['content']['limit']);
} else {
$products = Product::getNewProducts($id_lang, 0, (int) $node['content']['limit'], false, $node['content']['o'], $node['content']['ob']);
}
} elseif ($node['content']['ids'] == 's') {
if ($node['content']['o'] == 1) {
$products = Product::getPricesDrop($id_lang, 0, (int) $node['content']['limit']);
} else {
$products = Product::getPricesDrop($id_lang, 0, (int) $node['content']['limit'], false, $node['content']['o'], $node['content']['ob']);
}
} elseif ($node['content']['ids'] == 'b') {
//.........这里部分代码省略.........
示例15: renderContent
public function renderContent($args, $setting)
{
# validate module
unset($args);
$t = array('name' => '', 'html' => '');
$setting = array_merge($t, $setting);
$nb = $setting['itemstab'] ? (int) $setting['itemstab'] : 6;
$orderby = $setting['orderby'] ? $setting['orderby'] : 'date_add';
$orderway = $setting['orderway'] ? $setting['orderway'] : 'ASC';
$items_page = $setting['itemspage'] ? (int) $setting['itemspage'] : 3;
$columns_page = $setting['columns'] ? (int) $setting['columns'] : 3;
$interval = isset($setting['interval']) ? (int) $setting['interval'] : 8000;
switch ($setting['source']) {
case 'ptype':
switch ($setting['ptype']) {
case 'newest':
$products = Product::getNewProducts($this->langID, 0, $nb, false, $orderby, $orderway);
break;
case 'featured':
$category = new Category(Context::getContext()->shop->getCategory(), $this->langID);
$products = $category->getProducts((int) $this->langID, 1, $nb, $orderby, $orderway);
break;
case 'bestseller':
$products = ProductSale::getBestSalesLight((int) $this->langID, 0, $nb);
break;
case 'special':
$products = Product::getPricesDrop($this->langID, 0, $nb, false, $orderby, $orderway);
break;
case 'random':
$random = true;
$products = $this->getProducts('WHERE p.id_product > 0', (int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway, false, true, $random, $nb);
Configuration::updateValue('LEO_CURRENT_RANDOM_CACHE', '1');
break;
}
break;
case 'pproductids':
$where = '';
if (empty($setting['pproductids'])) {
return false;
}
if ($pproductids = $setting['pproductids']) {
$where = 'WHERE p.id_product IN (' . pSQL($pproductids) . ')';
}
$products = $this->getProducts($where, (int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway);
break;
case 'pcategories':
$where = '';
$catids = isset($setting['categories']) && $setting['categories'] ? $setting['categories'] : array();
$products = array();
if ($catids) {
$categorys = implode(',', $catids);
$where = 'WHERE cp.id_category IN (' . pSQL($categorys) . ')';
$products = $this->getProducts($where, (int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway);
}
break;
case 'pmanufacturers':
$where = '';
$manufacturers = $setting['pmanufacturer'] ? $setting['pmanufacturer'] : array();
if ($manufacturers) {
$manufacturers = implode(',', $manufacturers);
$where = 'WHERE p.id_manufacturer IN (' . pSQL($manufacturers) . ')';
}
$products = $this->getProducts($where, (int) Context::getContext()->language->id, 1, $nb, $orderby, $orderway);
break;
}
Context::getContext()->controller->addColorsToProductList($products);
$setting['products'] = $products;
$setting['itemsperpage'] = $items_page;
$setting['columnspage'] = $columns_page;
$setting['scolumn'] = 12 / $columns_page;
$setting['interval'] = $interval;
$setting['homeSize'] = Image::getSize(ImageType::getFormatedName('home'));
$setting['tab'] = 'leoproductcarousel' . rand(20, rand());
$output = array('type' => 'carousel', 'data' => $setting);
return $output;
}