Jump to content

Modyfikacja modułu productscategory pobranie produktów z tej samej kategorii i tego samego producenta


gopresta.pl

Recommended Posts

Chciałbym zmodyfikować moduł "productscategory" PS1.6 który pobiera "podobne" produkty czyli produkty z tej samej kategorii. Ja chciałbym aby pobierał produkty z tej samej kategorii i tego samego producenta. Wtedy przynajmniej w moim sklepie były by to rzeczywiście podobne produkty.

Domyślam się, że trzeba by zmodyfikować tą linię:

$category_products = $category->getProducts($this->context->language->id, 1, 100); /* 100 products max. */

Ktoś pomoże? :)

Edited by Meblolux (see edit history)
Link to comment
Share on other sites

Przed tą pętlą:

foreach ($category_products as $key => $category_product)
				{
					if ($category_product['id_product'] == $id_product)
					{
						unset($category_products[$key]);
						break;
					}
				}

Dodałbym jeszcze jedną:

foreach ($category_products as $key => $category_product)
				{
					if ($category_product['id_manufacturer'] != $product->id_manufacturer)
					{
						unset($category_products[$key]);
					}
				}

 

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