Jump to content

Facet navigation on the controller page in own module


Recommended Posts

Hello,

I have a question. I writed a new module it shows products by code:
 

		protected function getProducts(){
			$customer = $this->context->customer->id;

			$sql = 'SELECT p.* FROM `'._DB_PREFIX_.'product` p ORDER id ASC LIMIT 0,10';

			$products = Db::getInstance()->executeS($sql);

			$assembler = new ProductAssembler($this->context);

			$presenterFactory = new ProductPresenterFactory($this->context);
			$presentationSettings = $presenterFactory->getPresentationSettings();
			$presenter = new ProductListingPresenter(
				new ImageRetriever(
					$this->context->link
				),
				$this->context->link,
				new PriceFormatter(),
				new ProductColorsRetriever(),
				$this->context->getTranslator()
			);

			$products_for_template = [];

			foreach ($products as $rawProduct) {
				$products_for_template[] = $presenter->present(
					$presentationSettings,
					$assembler->assembleProduct($rawProduct),
					$this->context->language
				);
			}

			return $products_for_template;
		}

Above code return products which I can pass to file with product template on product list.

I would like show a facet navigation on the page where theses products will be show. It is possiiblity?

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