Jump to content

GetPriceDrop ne m'affiche aucun produit...


Recommended Posts

Bonjour,

J'ai un module dans mon thème que vous devez connaitre il s'agit de CS Products Filter

Il propose de faire affiché sur la page d'accueil un bloc à onglet qui reprend au choix, les produits phares ou d'autres choix.

 

Parmis ces choix il y l'option "special_products" qui fait appel à la fonction getPricesDrop

Je m'attendais donc à ce que ce soit les produits en promo qu'il reprendrait, hélas au lieu de ça il m'affiche une liste de produits quelconque je ne sais pourquoi ils les à choisi.

 

J'ai chercher de partout pour comprendre comment bien utiliser ces fonction getPricesDrop mais je n'ai rien trouver pour régler mon problème.

 

Si quelqu'un peut m'aider ce serait vraiment top car là je vois pas comment faire.

 

Je vous met le code qui reprend cet fonction :

public function getProductList($nb = 10)
	{
		global $cookie;
		if(strpos($this->product_type, "featured_products") !== false)
		{
			$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); 
			$this->product_list = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 20),NULL,NULL,false,true,true,($nb ? $nb : 20));
		}
		elseif(strpos($this->product_type, "special_products") !== false)
		{
           		
            $this->product_list = Product::getPricesDrop((int)($cookie->id_lang), 0, $nb);
		}
		elseif(strpos($this->product_type, "topseller_products") !== false)
		{
			$this->product_list = ProductSale::getBestSales((int)($cookie->id_lang), 0, $nb);
		}
		elseif(strpos($this->product_type, "new_products") !== false)
		{
			$this->product_list = Product::getNewProducts((int)($cookie->id_lang), 0, $nb);
		}
		elseif(strpos($this->product_type, "choose_the_category") !== false)
		{
			$category = new Category((int)$this->product_type_menu, (int)Context::getContext()->language->id);
			$this->product_list = $category->getProducts((int)($cookie->id_lang), 1, $nb);
			$this->cat_desc=$category->description;
			$link=new Link();
			$this->cat_link=$link->getCategoryLink((int)$this->product_type_menu);
			
		}	
	}

Ah oui j'oubliais, je suis sous prestashop 1.5.6.1

Link to comment
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...