Jump to content

Contenu des paniers clients vide dans le back office (Prestashop 1.5.1)


Recommended Posts

Bonjour,

 

Depuis que j'ai mis à jour Prestashop (1.5.0 vers 1.5.1), j'ai remarqué que je ne vois plus le contenu des paniers clients dans le back-office. (Que les utilisateurs soient loggés ou non).

La supression d'un panier depuis le back-office provoque bien sa supression dans le front-office, en revanche le contenu des paniers n'est jamais mis à jour dans le back office. Tous les paniers clients sont donc à un total de 0,00€: Les autres informations quant à elles sont mises à jour correctement (Transporteur, Date, client en ligne / hors ligne etc....)

 

Si quelqu'un a une idée d'où ça peut venir, merci de bien vouloir m'éclairer à ce sujet :)

 

Edit: Quelqu'un a le même problème, avec la même version de Prestashop sur le forum Espagnol : http://www.prestasho...-compras-vacio/

post-391417-0-44090100-1349779295_thumb.png

Edited by OxaD (see edit history)
  • Like 1
Link to comment
Share on other sites

Bonjour à tous,

Même problème que vous suite au passage de 1.5.0.17 en 1.5.1 via autoupgrade : dans le backoffice, les paniers accessibles par le menu Clients/Paniers s'affichent vides avec montant à 0 €.

 

En vérifiant dans la base de données, les tables ps_cart et ps_cart_product contiennent bien les données des paniers que le client soit enregistré ou non.

Il doit donc probablement s'agir d'un problème de requête SQL erronée pour l'affichage (je suppose dans le fichier /classes/Cart.php mais je n'ai pas trouvé le pb).

 

A suivre...

 

 

PS : parallèlement j'avais un problème de validation de panier sur le front que j'ai solutionné grâce au post http://www.prestasho...une-base-15017/

Link to comment
Share on other sites

Bonjour, effectivement les données sont biens présentes dans la BDD donc ça doit être lié à leur récupération. Personnellement, j'ai préféré revenir à la version 1.5.0.17 en attendant que cette dernière version devienne plus stable et plus optimisée. En revenant à la version précédente, en plus de solutionner mon problème je gagne également nettement en terme de performance.

Link to comment
Share on other sites

Bonjour,

 

Solution proposée ici : http://www.prestashop.com/forums/index.php?/topic/192618-add-to-cart-in-bo-doesnt-work-ps-151/page__view__findpost__p__955533

 

Erreur toujours d'actualité apparemment dans la svn

Perso, j'ai placé le correctif dans le dossier override/classes/Cart.php

public function getProducts($refresh = false, $id_product = false, $id_country = null)
{
 if (!$this->id)
  return array();
 // Product cache must be strictly compared to NULL, or else an empty cart will add dozens of queries
 if ($this->_products !== null && !$refresh)
 {
  // Return product row with specified ID if it exists
  if (is_int($id_product))
  {
   foreach ($this->_products as $product)
 if ($product['id_product'] == $id_product)
  return array($product);
   return array();
  }
  return $this->_products;
 }
 $shop_group = Shop::getGroupFromShop(Shop::getContextShopID(), false);
 if ($shop_group['share_order'])
  $id_shop = 'cp.id_shop';
 else
  $id_shop = (int)Shop::getContextShopID();
 if (!$id_country)
  $id_country = Context::getContext()->country->id;
 // Build query
 $sql = new DbQuery();
 // Build SELECT
 $sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`,
  pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, product_shop.`id_category_default`, p.`id_supplier`,
  p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`, product_shop.`available_for_order`, product_shop.`price`, p.`weight`,
  stock.`quantity` quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, product_shop.`active`, p.`date_add`,
  p.`date_upd`, t.`id_tax`, tl.`name` AS tax, t.`rate`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
  CONCAT(cp.`id_product`, cp.`id_product_attribute`, cp.`id_address_delivery`) AS unique_id, cp.id_address_delivery,
  product_shop.`wholesale_price`, product_shop.advanced_stock_management');
 // Build FROM
 $sql->from('cart_product', 'cp');
 // Build JOIN
 $sql->leftJoin('product', 'p', 'p.`id_product` = cp.`id_product`');
 $sql->join(Shop::addSqlAssociation('product', 'p'));
 $sql->leftJoin('product_lang', 'pl', '
  p.`id_product` = pl.`id_product`
  AND pl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('pl')
 );

 $sql->leftJoin('tax_rule', 'tr', '
  product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`
  AND tr.`id_country` = '.(int)$id_country.'
  AND tr.`id_state` = 0
  AND tr.`zipcode_from` = 0'
 );
 $sql->leftJoin('tax', 't', 't.`id_tax` = tr.`id_tax`');
 $sql->leftJoin('tax_lang', 'tl', '
  t.`id_tax` = tl.`id_tax`
  AND tl.`id_lang` = '.(int)$this->id_lang
 );
 $sql->leftJoin('category_lang', 'cl', '
  product_shop.`id_category_default` = cl.`id_category`
  AND cl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('cl')
 );
 // @todo test if everything is ok, then refactorise call of this method
 $sql->join(Product::sqlStock('cp', 'cp'));
 // Build WHERE clauses
 $sql->where('cp.`id_cart` = '.(int)$this->id);
 if ($id_product)
  $sql->where('cp.`id_product` = '.(int)$id_product);
 $sql->where('p.`id_product` IS NOT NULL');
 // Build GROUP BY
 $sql->groupBy('unique_id');
 // Build ORDER BY
 $sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC');
 if (Customization::isFeatureActive())
 {
  $sql->select('cu.`id_customization`, cu.`quantity` AS customization_quantity');
  $sql->leftJoin('customization', 'cu',
   'p.`id_product` = cu.`id_product` AND cp.`id_product_attribute` = cu.id_product_attribute AND cu.id_cart='.(int)$this->id);
 }
 else
  $sql->select('0 AS customization_quantity, 0 AS id_customization');
 if (Combination::isFeatureActive())
 {
  $sql->select('
   product_attribute_shop.`price` AS price_attribute, product_attribute_shop.`ecotax` AS ecotax_attr,
   IF (IFNULL(pa.`reference`, \'\') = \'\', p.`reference`, pa.`reference`) AS reference,
   IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference,
   (p.`weight`+ pa.`weight`) weight_attribute,
   IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13,
   IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc,
   pai.`id_image` as pai_id_image, il.`legend` as pai_legend,
   IFNULL(product_attribute_shop.`minimal_quantity`, product_shop.`minimal_quantity`) as minimal_quantity
  ');
  $sql->leftJoin('product_attribute', 'pa', 'pa.`id_product_attribute` = cp.`id_product_attribute`');
  $sql->leftJoin('product_attribute_shop', 'product_attribute_shop', 'product_attribute_shop.id_shop='.$id_shop);
  $sql->leftJoin('product_attribute_image', 'pai', 'pai.`id_product_attribute` = pa.`id_product_attribute`');
  $sql->leftJoin('image_lang', 'il', 'il.id_image = pai.id_image AND il.id_lang = '.(int)$this->id_lang);
 }
 else
  $sql->select(
   'p.`reference` AS reference, p.`supplier_reference` AS supplier_reference, p.`ean13`,
   p.`upc` AS upc, product_shop.`minimal_quantity` AS minimal_quantity'
  );
 $result = Db::getInstance()->executeS($sql);
 // Reset the cache before the following return, or else an empty cart will add dozens of queries
 $products_ids = array();
 $pa_ids = array();
 foreach ($result as $row)
 {
  $products_ids[] = $row['id_product'];
  $pa_ids[] = $row['id_product_attribute'];
 }
 // Thus you can avoid one query per product, because there will be only one query for all the products of the cart
 Product::cacheProductsFeatures($products_ids);
 Cart::cacheSomeAttributesLists($pa_ids, $this->id_lang);
 $this->_products = array();
 if (empty($result))
  return array();
 $cart_shop_context = Context::getContext()->cloneContext();
 foreach ($result as $row)
 {
  if (isset($row['ecotax_attr']) && $row['ecotax_attr'] > 0)
   $row['ecotax'] = (float)$row['ecotax_attr'];
  $row['stock_quantity'] = (int)$row['quantity'];
  // for compatibility with 1.2 themes
  $row['quantity'] = (int)$row['cart_quantity'];
  if (isset($row['id_product_attribute']) && (int)$row['id_product_attribute'] && isset($row['weight_attribute']))
   $row['weight'] = (float)$row['weight_attribute'];
  if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_invoice')
   $address_id = (int)$this->id_address_invoice;
  else
   $address_id = (int)$row['id_address_delivery'];
  if (!Address::addressExists($address_id))
   $address_id = null;
  if ($cart_shop_context->shop->id != $row['id_shop'])
   $cart_shop_context->shop = new Shop((int)$row['id_shop']);
  if ($this->_taxCalculationMethod == PS_TAX_EXC)
  {
   $row['price'] = Product::getPriceStatic(
 (int)$row['id_product'],
 false,
 isset($row['id_product_attribute']) ? (int)$row['id_product_attribute'] : null,
 2,
 null,
 false,
 true,
 (int)$row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $specific_price_output,
 true,
 true,
 $cart_shop_context
   ); // Here taxes are computed only once the quantity has been applied to the product price
   $row['price_wt'] = Product::getPriceStatic(
 (int)$row['id_product'],
 true,
 isset($row['id_product_attribute']) ? (int)$row['id_product_attribute'] : null,
 2,
 null,
 false,
 true,
 (int)$row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $null,
 true,
 true,
 $cart_shop_context
   );
   $tax_rate = Tax::getProductTaxRate((int)$row['id_product'], (int)$address_id);
   $row['total_wt'] = Tools::ps_round($row['price'] * (float)$row['cart_quantity'] * (1 + (float)$tax_rate / 100), 2);
   $row['total'] = $row['price'] * (int)$row['cart_quantity'];
  }
  else
  {
   $row['price'] = Product::getPriceStatic(
 (int)$row['id_product'],
 false,
 (int)$row['id_product_attribute'],
 2,
 null,
 false,
 true,
 $row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $specific_price_output,
 true,
 true,
 $cart_shop_context
   );
   $row['price_wt'] = Product::getPriceStatic(
 (int)$row['id_product'],
 true,
 (int)$row['id_product_attribute'],
 2,
 null,
 false,
 true,
 $row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $null,
 true,
 true,
 $cart_shop_context
   );

   // In case when you use QuantityDiscount, getPriceStatic() can be return more of 2 decimals
   $row['price_wt'] = Tools::ps_round($row['price_wt'], 2);
   $row['total_wt'] = $row['price_wt'] * (int)$row['cart_quantity'];
   $row['total'] = Tools::ps_round($row['price'] * (int)$row['cart_quantity'], 2);
  }
  if (!isset($row['pai_id_image']) || $row['pai_id_image'] == 0)
  {
   $row2 = Db::getInstance()->getRow('
 SELECT image_shop.`id_image` id_image, il.`legend`
 FROM `'._DB_PREFIX_.'image` i'.
 Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
 LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
 WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
   );
   if (!$row2)
 $row2 = array('id_image' => false, 'legend' => false);
   else
 $row = array_merge($row, $row2);
  }
  else
  {
   $row['id_image'] = $row['pai_id_image'];
   $row['legend'] = $row['pai_legend'];
  }
  $row['reduction_applies'] = ($specific_price_output && (float)$specific_price_output['reduction']);
  $row['quantity_discount_applies'] = ($specific_price_output && $row['cart_quantity'] >= (int)$specific_price_output['from_quantity']);
  $row['id_image'] = Product::defineProductImage($row, $this->id_lang);
  $row['allow_oosp'] = Product::isAvailableWhenOutOfStock($row['out_of_stock']);
  $row['features'] = Product::getFeaturesStatic((int)$row['id_product']);
  if (array_key_exists($row['id_product_attribute'].'-'.$this->id_lang, self::$_attributesLists))
   $row = array_merge($row, self::$_attributesLists[$row['id_product_attribute'].'-'.$this->id_lang]);
  $this->_products[] = $row;
 }
 return $this->_products;
}

  • Like 1
Link to comment
Share on other sites

Dans le dossier override/classes/

Si tu as un fichier Cart.php, mets le dedans.

Si tu n'en as pas, créé un fichier et place le code suivant dedans

<?php
class Cart extends CartCore
{
public function getProducts($refresh = false, $id_product = false, $id_country = null)
{
 if (!$this->id)
  return array();
 // Product cache must be strictly compared to NULL, or else an empty cart will add dozens of queries
 if ($this->_products !== null && !$refresh)
 {
  // Return product row with specified ID if it exists
  if (is_int($id_product))
  {
   foreach ($this->_products as $product)
 if ($product['id_product'] == $id_product)
  return array($product);
   return array();
  }
  return $this->_products;
 }
 $shop_group = Shop::getGroupFromShop(Shop::getContextShopID(), false);
 if ($shop_group['share_order'])
  $id_shop = 'cp.id_shop';
 else
  $id_shop = (int)Shop::getContextShopID();
 if (!$id_country)
  $id_country = Context::getContext()->country->id;
 // Build query
 $sql = new DbQuery();
 // Build SELECT
 $sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`,
  pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, product_shop.`id_category_default`, p.`id_supplier`,
  p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`, product_shop.`available_for_order`, product_shop.`price`, p.`weight`,
  stock.`quantity` quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, product_shop.`active`, p.`date_add`,
  p.`date_upd`, t.`id_tax`, tl.`name` AS tax, t.`rate`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
  CONCAT(cp.`id_product`, cp.`id_product_attribute`, cp.`id_address_delivery`) AS unique_id, cp.id_address_delivery,
  product_shop.`wholesale_price`, product_shop.advanced_stock_management');
 // Build FROM
 $sql->from('cart_product', 'cp');
 // Build JOIN
 $sql->leftJoin('product', 'p', 'p.`id_product` = cp.`id_product`');
 $sql->join(Shop::addSqlAssociation('product', 'p'));
 $sql->leftJoin('product_lang', 'pl', '
  p.`id_product` = pl.`id_product`
  AND pl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('pl')
 );

 $sql->leftJoin('tax_rule', 'tr', '
  product_shop.`id_tax_rules_group` = tr.`id_tax_rules_group`
  AND tr.`id_country` = '.(int)$id_country.'
  AND tr.`id_state` = 0
  AND tr.`zipcode_from` = 0'
 );
 $sql->leftJoin('tax', 't', 't.`id_tax` = tr.`id_tax`');
 $sql->leftJoin('tax_lang', 'tl', '
  t.`id_tax` = tl.`id_tax`
  AND tl.`id_lang` = '.(int)$this->id_lang
 );
 $sql->leftJoin('category_lang', 'cl', '
  product_shop.`id_category_default` = cl.`id_category`
  AND cl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('cl')
 );
 // @todo test if everything is ok, then refactorise call of this method
 $sql->join(Product::sqlStock('cp', 'cp'));
 // Build WHERE clauses
 $sql->where('cp.`id_cart` = '.(int)$this->id);
 if ($id_product)
  $sql->where('cp.`id_product` = '.(int)$id_product);
 $sql->where('p.`id_product` IS NOT NULL');
 // Build GROUP BY
 $sql->groupBy('unique_id');
 // Build ORDER BY
 $sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC');
 if (Customization::isFeatureActive())
 {
  $sql->select('cu.`id_customization`, cu.`quantity` AS customization_quantity');
  $sql->leftJoin('customization', 'cu',
   'p.`id_product` = cu.`id_product` AND cp.`id_product_attribute` = cu.id_product_attribute AND cu.id_cart='.(int)$this->id);
 }
 else
  $sql->select('0 AS customization_quantity, 0 AS id_customization');
 if (Combination::isFeatureActive())
 {
  $sql->select('
   product_attribute_shop.`price` AS price_attribute, product_attribute_shop.`ecotax` AS ecotax_attr,
   IF (IFNULL(pa.`reference`, \'\') = \'\', p.`reference`, pa.`reference`) AS reference,
   IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference,
   (p.`weight`+ pa.`weight`) weight_attribute,
   IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13,
   IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc,
   pai.`id_image` as pai_id_image, il.`legend` as pai_legend,
   IFNULL(product_attribute_shop.`minimal_quantity`, product_shop.`minimal_quantity`) as minimal_quantity
  ');
  $sql->leftJoin('product_attribute', 'pa', 'pa.`id_product_attribute` = cp.`id_product_attribute`');
  $sql->leftJoin('product_attribute_shop', 'product_attribute_shop', 'product_attribute_shop.id_shop='.$id_shop);
  $sql->leftJoin('product_attribute_image', 'pai', 'pai.`id_product_attribute` = pa.`id_product_attribute`');
  $sql->leftJoin('image_lang', 'il', 'il.id_image = pai.id_image AND il.id_lang = '.(int)$this->id_lang);
 }
 else
  $sql->select(
   'p.`reference` AS reference, p.`supplier_reference` AS supplier_reference, p.`ean13`,
   p.`upc` AS upc, product_shop.`minimal_quantity` AS minimal_quantity'
  );
 $result = Db::getInstance()->executeS($sql);
 // Reset the cache before the following return, or else an empty cart will add dozens of queries
 $products_ids = array();
 $pa_ids = array();
 foreach ($result as $row)
 {
  $products_ids[] = $row['id_product'];
  $pa_ids[] = $row['id_product_attribute'];
 }
 // Thus you can avoid one query per product, because there will be only one query for all the products of the cart
 Product::cacheProductsFeatures($products_ids);
 Cart::cacheSomeAttributesLists($pa_ids, $this->id_lang);
 $this->_products = array();
 if (empty($result))
  return array();
 $cart_shop_context = Context::getContext()->cloneContext();
 foreach ($result as $row)
 {
  if (isset($row['ecotax_attr']) && $row['ecotax_attr'] > 0)
   $row['ecotax'] = (float)$row['ecotax_attr'];
  $row['stock_quantity'] = (int)$row['quantity'];
  // for compatibility with 1.2 themes
  $row['quantity'] = (int)$row['cart_quantity'];
  if (isset($row['id_product_attribute']) && (int)$row['id_product_attribute'] && isset($row['weight_attribute']))
   $row['weight'] = (float)$row['weight_attribute'];
  if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_invoice')
   $address_id = (int)$this->id_address_invoice;
  else
   $address_id = (int)$row['id_address_delivery'];
  if (!Address::addressExists($address_id))
   $address_id = null;
  if ($cart_shop_context->shop->id != $row['id_shop'])
   $cart_shop_context->shop = new Shop((int)$row['id_shop']);
  if ($this->_taxCalculationMethod == PS_TAX_EXC)
  {
   $row['price'] = Product::getPriceStatic(
 (int)$row['id_product'],
 false,
 isset($row['id_product_attribute']) ? (int)$row['id_product_attribute'] : null,
 2,
 null,
 false,
 true,
 (int)$row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $specific_price_output,
 true,
 true,
 $cart_shop_context
   ); // Here taxes are computed only once the quantity has been applied to the product price
   $row['price_wt'] = Product::getPriceStatic(
 (int)$row['id_product'],
 true,
 isset($row['id_product_attribute']) ? (int)$row['id_product_attribute'] : null,
 2,
 null,
 false,
 true,
 (int)$row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $null,
 true,
 true,
 $cart_shop_context
   );
   $tax_rate = Tax::getProductTaxRate((int)$row['id_product'], (int)$address_id);
   $row['total_wt'] = Tools::ps_round($row['price'] * (float)$row['cart_quantity'] * (1 + (float)$tax_rate / 100), 2);
   $row['total'] = $row['price'] * (int)$row['cart_quantity'];
  }
  else
  {
   $row['price'] = Product::getPriceStatic(
 (int)$row['id_product'],
 false,
 (int)$row['id_product_attribute'],
 2,
 null,
 false,
 true,
 $row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $specific_price_output,
 true,
 true,
 $cart_shop_context
   );
   $row['price_wt'] = Product::getPriceStatic(
 (int)$row['id_product'],
 true,
 (int)$row['id_product_attribute'],
 2,
 null,
 false,
 true,
 $row['cart_quantity'],
 false,
 ((int)$this->id_customer ? (int)$this->id_customer : null),
 (int)$this->id,
 ((int)$address_id ? (int)$address_id : null),
 $null,
 true,
 true,
 $cart_shop_context
   );

   // In case when you use QuantityDiscount, getPriceStatic() can be return more of 2 decimals
   $row['price_wt'] = Tools::ps_round($row['price_wt'], 2);
   $row['total_wt'] = $row['price_wt'] * (int)$row['cart_quantity'];
   $row['total'] = Tools::ps_round($row['price'] * (int)$row['cart_quantity'], 2);
  }
  if (!isset($row['pai_id_image']) || $row['pai_id_image'] == 0)
  {
   $row2 = Db::getInstance()->getRow('
 SELECT image_shop.`id_image` id_image, il.`legend`
 FROM `'._DB_PREFIX_.'image` i'.
 Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
 LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
 WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
   );
   if (!$row2)
 $row2 = array('id_image' => false, 'legend' => false);
   else
 $row = array_merge($row, $row2);
  }
  else
  {
   $row['id_image'] = $row['pai_id_image'];
   $row['legend'] = $row['pai_legend'];
  }
  $row['reduction_applies'] = ($specific_price_output && (float)$specific_price_output['reduction']);
  $row['quantity_discount_applies'] = ($specific_price_output && $row['cart_quantity'] >= (int)$specific_price_output['from_quantity']);
  $row['id_image'] = Product::defineProductImage($row, $this->id_lang);
  $row['allow_oosp'] = Product::isAvailableWhenOutOfStock($row['out_of_stock']);
  $row['features'] = Product::getFeaturesStatic((int)$row['id_product']);
  if (array_key_exists($row['id_product_attribute'].'-'.$this->id_lang, self::$_attributesLists))
   $row = array_merge($row, self::$_attributesLists[$row['id_product_attribute'].'-'.$this->id_lang]);
  $this->_products[] = $row;
 }
 return $this->_products;
}



}

  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Bonjour,

merci pour le correctif mais quand je le met ca me fait 2 problèmes !

- Ca rajoute 0.42 cts d'Euros à mes frais de livraison

- Ca enlève le prix des produits dans bloc panier (ex : 1 pull x 15.99€ :ca donne 1 pull x free ! )

 

qui a une solution? qui a eu ce pb?

MERCI :)

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...