Jump to content

Best seller module: show only available products


Recommended Posts

Ah, sorry I missed the title.
You need to modify the sql query of ProductSale::getBestSalesLight

You can find the class file inside classes/

See this part

		$sql.= '
		WHERE product_shop.`active` = 1
		AND p.`visibility` != \'none\'
		GROUP BY product_shop.id_product
		ORDER BY sales DESC
		LIMIT '.(int)($page_number * $nb_products).', '.(int)$nb_products;

add the following

 

AND stock.quantity > 0

Right after the first AND

Link to comment
Share on other sites

×
×
  • Create New...