Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Как полулить массив товаров добавлены в сравнении


 Share

Recommended Posts

Добрый вечер.

Как можно заполулить массив товаров добавленные в сравнении в Open Cart 3 ?

Нужно все это вывести на страниэто категории.

Я пока что гделал хотя бы ик что бы понять как рилииет контроллер.

К примеру что бы вывести товары добавленные в Wishlist на страниэто категории я добавил в контроллер: 

 

$data['productsw'] = array();
		
		$resultsw = $this->model_account_wishlist->getWishlist();
		
		foreach ($resultsw as $resultw) {
			$product_infow = $this->model_catalog_product->getProduct($resultw['product_id']);

			if ($product_infow) {
				$data['productsw'][] = array(
					'product_id' => $product_infow['product_id'],
					'name'       => $product_infow['name']
				);
			} else {
				$this->model_account_wishlist->deleteWishlist($resultw['product_id']);
			}
		}

дное я хочу посмотреть все что передается через twig: {{ dump(productsw)}}

но на страниэто выводится только NULL.

Как можно создать кастомные массивы в контролере ?

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.