-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Proposing a small addition to allow using direct urls to filter category pages. It:
- Prevents double loading products (currently products are reloaded via ajax call when the url has # filter or # pagination parameters).
- Keeps compatibility with existing themes
Hooking to actionProductListOverride and catching 'selected_filters' get parameters would allow using direct urls like:
https://front.thirtybees.com/coffee-and-tea?selected_filters=/categories-coffee/exclusive_buy-yes
and even pagination
https://front.thirtybees.com/coffee-and-tea?selected_filters=/categories-coffee/exclusive_buy-yes/&p=2
public function hookActionProductListOverride($params)
{
if(Tools::getValue('selected_filters')){
$selected_filters = $this->getSelectedFilters();
$this->getProducts($selected_filters, $products, $nb_products, $p, $n, $pages_nb, $start, $stop, $range);
$params['nbProducts'] = $nb_products;
$params['catProducts'] = $products;
$params['hookExecuted'] = true;
}
}
What do you guys think? Is there already a way to do this?