Home › Forums › WoodMart support forum › Pagination
Pagination
- This topic has 10 replies, 2 voices, and was last updated 1 week, 6 days ago by
Artem Temos.
-
AuthorPosts
-
March 12, 2025 at 4:39 pm #645279
piotrburchartParticipantHi,
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/uZ0k5ybeQlCV0e5hI1zPPiotr
March 13, 2025 at 10:16 am #645432
Artem TemosKeymasterHello,
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
andget_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
March 13, 2025 at 12:07 pm #645519
piotrburchartParticipantGood morning,
So it doesn’t matter how you sort products in a specific category?
Thank youMarch 13, 2025 at 1:13 pm #645554
Artem TemosKeymasterCould you please clarify what sorting you mean? Send us a screenshot.
March 13, 2025 at 3:19 pm #645616
piotrburchartParticipantHi,
Within each category I sorted my products like that:
https://ibb.co/MDCBPH8q – image preview is cut from left, or this is ok?
Piotr
March 13, 2025 at 3:38 pm #645629
piotrburchartParticipantHi,
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-girlfriendhttps://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
March 13, 2025 at 3:47 pm #645632
piotrburchartParticipantAlso,
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/jYHgn2kIn 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
March 13, 2025 at 4:27 pm #645656
piotrburchartParticipantHi 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
March 14, 2025 at 10:43 am #645811
Artem TemosKeymasterTry 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');
March 14, 2025 at 12:00 pm #645848
piotrburchartParticipantPerfect, thank you so much. Please close this ticket.
March 14, 2025 at 12:50 pm #645860
Artem TemosKeymasterYou are always welcome.
-
AuthorPosts
The topic ‘Pagination’ is closed to new replies.
- You must be logged in to create new topics. Login / Register