Jump to content

Variable available_later & available_now

Recommended Posts



je souhaite récupérer et intégrer les variables available_later & available_now situées dans product_lang pour les modules bestsellers et newproducts.


Module Bestsellers:


{$best_sellers.1.available_later} {$best_sellers.1.available_now}


Il me semble que la requete à modifier est ici mais, il faut intégrer quoi ?


public static function getBestSalesLight($id_lang, $pageNumber = 0, $nbProducts = 10)
  global $link;
 if ($pageNumber < 0) $pageNumber = 0;
 if ($nbProducts < 1) $nbProducts = 10;

 $groups = FrontController::getCurrentCustomerGroups();
 $sqlGroups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
 $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
 SELECT p.id_product, p.quantity, pl.`link_rewrite`, pl.`name`, pl.`description_short`, i.`id_image`, il.`legend`, ps.`quantity` AS sales, p.`ean13`, p.`upc`, cl.`link_rewrite` AS category
 FROM `'._DB_PREFIX_.'product_sale` ps
 LEFT JOIN `'._DB_PREFIX_.'product` p ON ps.`id_product` = p.`id_product`
 LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.')
 LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1)
 LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.')
 LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (cl.`id_category` = p.`id_category_default` AND cl.`id_lang` = '.(int)$id_lang.')
 WHERE p.`active` = 1
 AND p.`id_product` IN (
  SELECT cp.`id_product`
  FROM `'._DB_PREFIX_.'category_group` cg
  LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = cg.`id_category`)
  WHERE cg.`id_group` '.$sqlGroups.'
 LIMIT '.(int)($pageNumber * $nbProducts).', '.(int)($nbProducts));
 if (!$result)
  return false;
 foreach ($result AS &$row)
$row['link'] = $link->getProductLink($row['id_product'], $row['link_rewrite'], $row['category'], $row['ean13']);
$row['id_image'] = Product::defineProductImage($row, $id_lang);
 return $result;


Module Newproduct:


{$newproduct.available_later} {$newproduct.available_now}


Je ne sais pas ou se trouve la variable à modifier


merci de votre aide





Share this post

Link to post
Share on other sites



pour le coter .tpl ca doit être {$product->available_now} et {$product->available_later}


coter php regarde dans classes/cart.php ou product.php cest déclarer avec pl.available_now et pl.available_later dans les requête sql





Share this post

Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More