Next/Previous Product buttons don't always sort as the Div Listing does.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
7 years 11 months ago #271564

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 5.6.16

We're about to launch a site with about 1400 items in a couple of hundred categories. On our Category Listing pages, the Categories are sorted by product_name while the Products are sorted by product_code. The listing displays work precisely as we expect, but when we view an individual Product, the Next/Previous buttons at the top of the layout don't always follow the product_code sort order. Since the Products were inserted using a spreadsheet, the product_id values are mostly sequential as well, so it isn't sorting by that method, either. Whatever sequence they are following, it seems to be consistent between sessions. This mismatch doesn't happen for all the categories, but so far, we can't find a pattern.

The default Product ordering settings are set for product_code/ascending and the Hikashop default menu entry is set that way as well. All of the menu items have been told to inherit these settings. There are three top-level Category Listing pages - Cast Stone, Plaster, and GFRC Resin, and there are two submenu Category Listings under Mantels - Cast Stone Mantels and Plaster Mantels. While these are not the only Categories that display this behavior, they have done it consistently.

Any suggestions?

Please Log in or Create an account to join the conversation.

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
7 years 11 months ago #271624

Hi,

If you go in the products listing on your backend, you'll see a column "order" with an input field for each product and you can configure the order of the products in each category that way.
You can even automate that when you import a CSV of the products with the categories_ordering column. In that column you can enter the ordering position of the product in each category of the product.

The next/previous buttons on the product page base themselves on the ordering of the products in the category of the product because on the product page, the system doesn't have the knowledge of how the products are ordered on the listing from where you're accessing the product page.

Please Log in or Create an account to join the conversation.

  • Posts: 144
  • Thank you received: 4
  • Hikashop Business
7 years 11 months ago #271800

Alright. So, if I understand your message correctly, the Next/Previous Product buttons work solely off of the Ordering value which is stored in the hikashop_product_category table, rather than by any other Product value (which would require joining tables for that SQL query).

If having Next/Previous Buttons recognize either
A) a default Product Page configuration setting, or
B) a default Category configuration value isn't on the wish list,
please add it as a suggestion. Having conflicting navigation schemes within a single Category Listing Page work differently is disconcerting.

Meanwhile, since this is something I hope to apply universally, I have a sneaking suspicion I can write a plugin to recognize a Product Page layout and swap the Hikashop Next/Previous buttons with a more flexibly configured pair of my own buttons.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 83806
  • Thank you received: 13571
  • MODERATOR
7 years 11 months ago #271809

Hi,

Supporting the ordering of the listing from where the customer comes from is quite tricky for several reasons:
- As you say it requires loading the settings of the listing so it's one more query.
- With the force canonical URL on listing setting, you don't even know where you're coming from when you click on a product page link since you can change the current menu item.
- If you come from a "best seller" products listing module, do you want to have the next/previous buttons be based on the ordering of the best seller listing module ? And if so, that would require adding an extra parameter to the URL to know from which module the customer is coming from so that the settings of the module can be used instead.

So while that's something we could look at improving, we're not sure as to how to do it properly in order to handle all the different cases.

You sure can write a plugin to have the buttons behave differently. You can even directly edit the file "show" of the view "product" via the menu Display>Views. The buttons are displayed near the top of the file.

The following user(s) said Thank You: icomex

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum