Hi,
The next and previous buttons on the product details page will display based on the category from which the customer accessed it.
You can see the "category_pathway" parameter in your two URLs. The 23 and 2 after them correspond to the id of the category from which you access these products.
The next and previous buttons allow you to access other products in that category.
If you don't see the buttons when the category_pathway is "2", it means that there are no other products directly linked to that category.
I think that's because you're in a special case:
- you products are not linked to the main category
- you've configured a products listing menu item with its "sub elements filter" set to "group by category"
- you've turned off the "simplified category" setting
Because of all this, the category_pathway takes on the id of the main category of the menu item, instead of one of the categories of the product.
If you turned back on the "simplified category" setting, then the category_pathway parameter would be removed from the URL, and HikaShop would base itself on the main (first) category of the product to look for next and previous products and display the buttons on the product details page.
If you add the main category in the list of categories of your products, then you would also get the back and next buttons as all the products would be linked to it.
Another option is to not change anything in the settings, and instead make a view override of product / listing via the menu Display>Views and add the code:
$this->category_pathway = '&category_pathway='.$category['category']->category_id;
after the line:
$this->params->set('main_div_name', $main_div_name.'_'.$category['category']->category_id);
This way, on a products listing grouped by category, the category_pathway parameter will be overridden to get the id of the category being used for the grouping instead of the using the main category of the listing. This means that HikaShop won't generate the URL with the category_pathway with the value 2 on the listing.
In fact, I'm thinking about adding something along those lines on our end so that it reflects more precisely the situation on a "group by category" menu item.