jmstyle008 Posted August 28, 2013 Share Posted August 28, 2013 Hi, I'm new to Prestashop and i saw that i'm in need of overriding this hook.. actionProductListOverride. I thought it was a method called actionProductListOverride but i could not find it or isn't there How could i over ride this method so i can add extra data to my CategoryController. the method i wish to override is this. /** * Assign list of products template vars */ public function assignProductList() { $hookExecuted = false; Hook::exec('actionProductListOverride', array( 'nbProducts' => &$this->nbProducts, 'catProducts' => &$this->cat_products, 'hookExecuted' => &$hookExecuted, )); // The hook was not executed, standard working if (!$hookExecuted) { $this->context->smarty->assign('categoryNameComplement', ''); $this->nbProducts = $this->category->getProducts(null, null, null, $this->orderBy, $this->orderWay, true); $this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts" $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay); } // Hook executed, use the override else // Pagination must be call after "getProducts" $this->pagination($this->nbProducts); foreach ($this->cat_products as &$product) { if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity'])) $product['minimal_quantity'] = $product['product_attribute_minimal_quantity']; } $this->context->smarty->assign('nb_products', $this->nbProducts); } Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted August 28, 2013 Share Posted August 28, 2013 Hi, you need to register your own module in $this->registerHook('productListAssign') hook. Your can find example in standart blocklayared module. Regards Link to comment Share on other sites More sharing options...
aliabc Posted September 4, 2014 Share Posted September 4, 2014 http://www.prestashop.com/forums/topic/321924-how-to-change-category-product-list-sql/ The link is talking about actionProductListOverride ,good luck! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now