Merge branch 'ticket-criteo' into develop

This commit is contained in:
Marion Muszynski 2016-07-28 11:49:12 +02:00
commit 8993c8e126

View File

@ -361,7 +361,6 @@ class Criteo_bbb extends Module
$id_products[] = (int) $product['id_product'];
}
}
echo '<pre>';var_dump($params['products'], $id_products);echo '</pre>';die();
$products_sales = array();
foreach(Db::getInstance()->ExecuteS('
SELECT `id_product`, `id_sale`
@ -378,15 +377,17 @@ class Criteo_bbb extends Module
$product_result = array();
foreach ($params['products'] as $product) {
if(isset($products_sales[(int) $product['id_product']])) {
if(!isset($product_result[$products_sales[(int) $product['id_product']]])) {
$product_result[$products_sales[(int) $product['id_product']]] = 0;
foreach($params['products'] as $delay) {
foreach ($delay['products'] as $product) {
if(isset($products_sales[(int) $product['id_product']])) {
if(!isset($product_result[$products_sales[(int) $product['id_product']]])) {
$product_result[$products_sales[(int) $product['id_product']]] = 0;
}
$product_obj = new Product((int)$product['id_product']);
$price = $product_obj->getPrice(true, ($product['id_product_attribute'] ? $product['id_product_attribute'] : (int)Product::getDefaultAttribute($product_obj->id)), 2);
$product_result[$products_sales[(int) $product['id_product']]] += $price * (int) $product['quantity'];
unset($product_obj);
}
$product_obj = new Product((int)$product['id_product']);
$price = $product_obj->getPrice(true, ($product['id_product_attribute'] ? $product['id_product_attribute'] : (int)Product::getDefaultAttribute($product_obj->id)), 2);
$product_result[$products_sales[(int) $product['id_product']]] += $price * (int) $product['quantity'];
unset($product_obj);
}
}