Tagged: pagination
-
AuthorPosts
-
May 25, 2021 at 9:14 pm #1302297
Thanks for making and supporting Enfold. Great theme!
I’m using Enfold, Woocommerce and an extension called Product Filter for WooCommerce. Enfold theme will not display pagination generated by Product Filter for WooCommerce, but other themes will (Twenty-Twenty One, Storefront). Ultimately, I will use a child theme but I want to get this working on Enfold parent first.
Is there some setting that I’m missing to get pagination to show? Will you please take a look?
- This topic was modified 3 years, 7 months ago by psstudiosinc.
May 27, 2021 at 11:20 am #1302577Hey psstudiosinc,
Thank you for the inquiry.
It’s possible that the pagination is not displaying because of these lines in the enfold/config-woocommerce/config.php file.
line 312:
remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); remove_action( 'woocommerce_pagination', 'woocommerce_pagination', 10 );
line 330:
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); //remove rating remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); //remove woo pagination
Try to remove the lines, remove the cache and see if the default pagination displays. This might duplicate the pagination on pages using the Product Grid element.
Best regards,
IsmaelMay 27, 2021 at 7:18 pm #1302710Thanks for your response. This does allow pagination to show when I modify the parent theme file. I tried to copy that file to the same location in the child theme but that doesn’t work.
How can I affect this change in the child theme?
May 28, 2021 at 1:53 pm #1302832Hi,
You can try this snippet in the child theme’s functions.php file to override the modification.
add_action("after_setup_theme", function() { add_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10 ); add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); //remove rating add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 ); //remove woo pagination }, 999);
If this is not working, try to use the same hooks with adjusted priority number.
add_action("init", function() { add_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 25 ); add_action( 'woocommerce_pagination', 'woocommerce_pagination', 15 ); add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 10 ); //remove rating add_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 15 ); //remove woo pagination }, 999);
Best regards,
IsmaelMay 28, 2021 at 7:44 pm #1302882Thank you – this works to display the woocommerce pagination. However, when I click the pagination links they just reload the first pages’ content, even though the URL parameter changes and looks to be correct. Any thoughts on why or how to fix this?
ps: I’ve only tested adding the function above on my local install – not the staging site. So if you need to work on the staging site, let me know and I’ll upload the changes to it.
May 31, 2021 at 8:02 am #1303101Hi,
We added the snippet in the staging but as you have observed, the pagination is not working correctly. All we did above is re-enable the unmodified default pagination of the shop plugin, which the theme hides and replaces with its custom pagination.
Unfortunately, we have no idea how the plugin modifies the default Woocommerce pagination, or if it alters the default product query. Please contact the plugin developers for more info about the issue.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.