162 lines
5.3 KiB
PHP
162 lines
5.3 KiB
PHP
<?php
|
|
class Product extends ProductCore
|
|
{
|
|
/*
|
|
* module: amazzingfilter
|
|
* date: 2019-04-02 12:04:07
|
|
* version: 2.8.4
|
|
*/
|
|
public static function getPricesDrop(
|
|
$id_lang,
|
|
$page_number = 0,
|
|
$nb_products = 10,
|
|
$count = false,
|
|
$order_by = null,
|
|
$order_way = null,
|
|
$beginning = false,
|
|
$ending = false,
|
|
Context $context = null
|
|
) {
|
|
if (!$context) {
|
|
$context = Context::getContext();
|
|
}
|
|
if (isset($context->filtered_result) && $context->filtered_result['controller'] == 'pricesdrop') {
|
|
if ($count) {
|
|
return $context->filtered_result['total'];
|
|
}
|
|
return $context->filtered_result['products'];
|
|
} else {
|
|
return parent::getPricesDrop(
|
|
$id_lang,
|
|
$page_number,
|
|
$nb_products,
|
|
$count,
|
|
$order_by,
|
|
$order_way,
|
|
$beginning,
|
|
$ending,
|
|
$context
|
|
);
|
|
}
|
|
}
|
|
/*
|
|
* module: amazzingfilter
|
|
* date: 2019-04-02 12:04:07
|
|
* version: 2.8.4
|
|
*/
|
|
public static function getNewProducts(
|
|
$id_lang,
|
|
$page_number = 0,
|
|
$nb_products = 10,
|
|
$count = false,
|
|
$order_by = 'date_add',
|
|
$order_way = 'desc',
|
|
Context $context = null
|
|
) {
|
|
if (!$context) {
|
|
$context = Context::getContext();
|
|
}
|
|
if (isset($context->filtered_result) && $context->filtered_result['controller'] == 'newproducts') {
|
|
if ($count) {
|
|
return $context->filtered_result['total'];
|
|
}
|
|
return $context->filtered_result['products'];
|
|
} else {
|
|
return parent::getNewProducts(
|
|
$id_lang,
|
|
$page_number,
|
|
$nb_products,
|
|
$count,
|
|
$order_by,
|
|
$order_way,
|
|
$context
|
|
);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* module: amazzingfilter
|
|
* date: 2019-04-02 12:04:07
|
|
* version: 2.8.4
|
|
*/
|
|
public static function getProductsProperties($id_lang, $query_result)
|
|
{
|
|
if (!empty(Context::getContext()->properties_not_required)) {
|
|
return $query_result;
|
|
} else {
|
|
return parent::getProductsProperties($id_lang, $query_result);
|
|
}
|
|
}
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $in_google_shopping;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $product_name_google_shopping;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $product_short_desc_google_shopping;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $custom_label_0;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $custom_label_1;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $custom_label_2;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $custom_label_3;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public $custom_label_4;
|
|
/*
|
|
* module: pdgooglemerchantcenterpro
|
|
* date: 2023-05-08 18:11:02
|
|
* version: 2.5.2
|
|
*/
|
|
public function __construct($id_product = null, $full = false, $id_lang = null, $id_shop = null, Context $context = null)
|
|
{
|
|
if (Configuration::get('PD_GMCP_ASSIGN_ON_ADD')) {
|
|
$this->in_google_shopping = 1;
|
|
}
|
|
|
|
self::$definition['fields']['in_google_shopping'] = array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool');
|
|
self::$definition['fields']['product_name_google_shopping'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 128);
|
|
self::$definition['fields']['product_short_desc_google_shopping'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml', 'required' => false);
|
|
self::$definition['fields']['custom_label_0'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 128);
|
|
self::$definition['fields']['custom_label_1'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 100);
|
|
self::$definition['fields']['custom_label_2'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 100);
|
|
self::$definition['fields']['custom_label_3'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 100);
|
|
self::$definition['fields']['custom_label_4'] = array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => false, 'size' => 100);
|
|
parent::__construct($id_product, $full, $id_lang, $id_shop, $context);
|
|
}
|
|
|
|
|
|
}
|