Home Forums WoodMart support forum Pagination

Pagination

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #645279

    piotrburchart
    Participant

    Hi,
    Is it possible to set the pagination according to the order of products arranged in the category/in order?
    For example: when I am on the Shell Angels category and I press the first product and then I use the navigation (next and previous buttons), the products do not go in order on the category page. Please watch the video:
    https://jumpshare.com/s/uZ0k5ybeQlCV0e5hI1zP

    Piotr

    #645432

    Artem Temos
    Keymaster

    Hello,

    By default, the WooCommerce plugin doesn’t have products next/previous arrows functionality at all. To implement this feature we use standard WordPress PHP get_next_post and get_prev_post functions that can obtain adjacent posts from the database. Unfortunately, it takes products from the whole table and depends only on the shop page order. The system can’t know that you previously visited this product’s category page. Yes, it would be much better to show next/prev product from the same category. But how the system might know which one? The product can be from multiple categories. Then, from which category next product should be taken? Or for example, if I use filter by price or by color/size the order for products changes again. And naturally, that when you open some product from that page you must see products from the same color/size or from the same price filter interval. And there are a lot of such cases that make it impossible to make product arrows buttons work as expected.

    Kind Regards

    #645519

    piotrburchart
    Participant

    Good morning,
    So it doesn’t matter how you sort products in a specific category?
    Thank you

    #645554

    Artem Temos
    Keymaster

    Could you please clarify what sorting you mean? Send us a screenshot.

    #645616

    piotrburchart
    Participant

    Hi,

    Within each category I sorted my products like that:

    https://ibb.co/5H7ZxG0

    https://ibb.co/CGhdkND

    https://ibb.co/Jwgv2k2k

    https://ibb.co/MDCBPH8q – image preview is cut from left, or this is ok?

    Piotr

    #645629

    piotrburchart
    Participant

    Hi,

    In addition I have a page build in WIX as well: https://www.heartincreation.com/
    And this is Valentine’s Day Cards: https://www.heartincreation.com/category/handmade-valentines-day-cards
    We have cards put in my custom order on page.
    Then, when you click on the first image/product you will have single product page with pagination:
    https://www.heartincreation.com/product-page/handmade-valentine-s-day-card-for-my-girlfriend

    https://ibb.co/xSrrQkbS
    Previous button is inactive because this is first card in category, and when you click on the next, you will go to the next card like on the category page.

    Piotr

    #645632

    piotrburchart
    Participant

    Also,

    Old page built in Flatsome ( PS: I decided to use Woodmart 🙂

    Handmade Birthday Card category: https://ibb.co/Wp51dGFD
    Single : https://ibb.co/FLqvZk0S – you can notice here that previous button is inactive, and next button active with the preview on hover with the next birthday cards from category https://ibb.co/jYHgn2k

    In summary when I click on the next and previous buttons from pagination on single product page, I can navigate to the cards from the same category and in order arranged by me. Do you need more info from me?

    Piotr

    #645656

    piotrburchart
    Participant

    Hi again,

    I checked your demo as well: https://woodmart.xtemos.com/product-category/accessories/
    And when you navigate between products between this category from first to last one you can only see products from this “accessories” you are jumping to other categories like on my site :https://heartincreation.co.uk/unique-homemade-birthday-card-with-present-made-of-cork/ – when you click on the next button you will jump to the thank you cards instead next card from the birthday cards. I hope I explained everything correctly.

    Thank you

    #645811

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    add_action('woodmart_get_prev_product_same_term', '__return_true');

    #645848

    piotrburchart
    Participant

    Perfect, thank you so much. Please close this ticket.

    #645860

    Artem Temos
    Keymaster

    You are always welcome.

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘Pagination’ is closed to new replies.