Left – right product navigation order not ok

This topic has 7 replies, 2 voices, and was last updated 3 years, 6 months ago ago by Olga Barlow

  • Avatar: Adrian
    Adrian
    Participant
    August 10, 2020 at 12:13

    Hello,
    The previous – next navigation on the single product page does’t work correctly for my Sales categories. Please see the video bellow. It should show the next or previous product in the category, but sometimes it jumps out of the current category and into the main category of that product.

    Thanks!

    https://streamable.com/z7u2gy

    6 Answers
    Avatar: Adrian
    Adrian
    Participant
    August 11, 2020 at 09:27

    Please help.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 11, 2020 at 09:52

    Hello,

    Prev/Next products displays from the total products list in the order it was added to your site. Our developers are looking if it’s possible to show the products only from the category but we need more time to find out if it’s possible to implement. I’ll inform you once get the answer from our developers.

    Regards

    Avatar: Adrian
    Adrian
    Participant
    August 11, 2020 at 18:34

    Thanks. The prev/next navigation is a great feature and it would only make sense if the order of the items follows the order in which they are displayed in the category (at least the main category).

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 12, 2020 at 15:29

    Hello,

    We use the default WordPress functions to get pre/next products from the category https://developer.wordpress.org/reference/functions/get_adjacent_post/
    And it displays the products from the main category https://gyazo.com/419544a5a2659e5f0c2e564291f08cf4 not from the subcategory. So, unfortunately, navigation will display products from main category.

    Regards

    Avatar: Adrian
    Adrian
    Participant
    August 12, 2020 at 21:25

    OK, i understand. My solution would be to change the main category of the products to SALE. But, on my website, i have added a custom function that sorts the products by SKU. From your explanation i understand that default prev/next order is the order in which the products have been added. So i need to change the prev/next order to also be by SKU. Can you help me with this? Or, at least, point me to the theme file and code lines that implement the order of the prev/next , so i can customize it myself?

    Thank you!

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    August 13, 2020 at 11:03

    Hello,

    Copy et_visible_pruduct function (xstore/framework/theme-functions.php) to child theme functions.php and edit it according to your needs. Or submit customization request here to get help with this from the customization team.

    Regards

  • Viewing 7 results - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.Log in/Sign up

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.