neastea18 Posted January 16, 2012 Share Posted January 16, 2012 Bonsoir, 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.' ) ORDER BY sales DESC 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 cdt, UP Link to comment Share on other sites More sharing options...
neastea18 Posted January 21, 2012 Author Share Posted January 21, 2012 Un petit UP car, je pense que je ne suis pas le seul dans ce cas cdt, Link to comment Share on other sites More sharing options...
loulou66 Posted January 22, 2012 Share Posted January 22, 2012 coucou 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 @++ Loulou66 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now