-
AuthorPosts
-
November 3, 2016 at 11:44 am #707675
Hi,
I’m writting you because I can’t find a workable solution :)I would like to put a “Show all products” button above the pagination in the archive products pages.
This button will show all products in one page (no more pagination) for the concerned category.Thank you very much for your help !
Regards,
ThibaultNovember 5, 2016 at 6:04 am #708550Hey Obeatone,
Thank you for using Enfold.
Please add this in the functions.php file:
add_action('woocommerce_before_shop_loop', 'ava_show_all_product_mod', 10, 1); function ava_show_all_product_mod($post) { global $post; $all = "?product_count=1000"; echo "<a href='{$all}' class='all_product'>Show all</a>"; }
Best regards,
IsmaelNovember 5, 2016 at 11:37 am #708664Hi Ismael,
Thank you for your help !It works but now, it is always displaying all products.
I would like to display 9 products when I click on another category or in the same category (without ?product_count=1000).Thank you for your help !
Regards,
ThibaultNovember 7, 2016 at 4:06 pm #709327November 7, 2016 at 4:36 pm #709351Sorry you don’t understand :)
I want to show all products like Ismael told me. But after changing page that it is not possible to show 9 products per pages like I configured it.I would like to put the show all button and after clicking on it, all products are showing. And after changing the category in the menu, I would like to reset automatically and to show 9 products like configured.
Thank you for helping !
regardsNovember 10, 2016 at 6:30 am #710546Hi!
How can we change the category? I’m probably missing something because I don’t understand the language. A screenshot will help.
Regards,
IsmaelNovember 10, 2016 at 10:30 am #710616Hi,
Sorry for my english, I will try to explain it better :)So in my case here is the problem :
– I’m on products category page with 9 products per page : http://adelineaffre.com/website/bijoux/nouvelle-collection/
– I click on Show all, it works fine and i can see all the products on one page : http://adelineaffre.com/website/bijoux/nouvelle-collection/?product_count=1000
– I click on another category : http://adelineaffre.com/website/bijoux/bijoux/
> And now I see all products in one page and that is not OK :) I would like to see 9 products and to choose if i want to show all by clicking on the button (reset when i change the product category)Here is an exemple of what I want : http://blubertyme.com/15-accessoires
When I click on show all (tout voir), I can see all products on one page but when i click on another category (http://blubertyme.com/16-esquisses) all products are not showing, I have to click another time on the show all button to see all products in one page.Thank you for your help !
RegardsNovember 14, 2016 at 6:36 am #711791Hi!
Thank you for the info. Please replace the code in the functions.php file with the following.
add_action('woocommerce_before_shop_loop', 'ava_show_all_product_mod', 10, 1); function ava_show_all_product_mod($post) { global $post; $per_page = get_option('avia_woocommerce_product_count'); $url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" . avia_woo_build_query_string($params, 'product_count', $per_page * 50); unset($_SESSION['product_count']); session_destroy(); echo "<a href='{$url}' class='all_product'>Show all</a>"; }
Regards,
IsmaelNovember 14, 2016 at 11:00 am #711859Thank you Ismael, It works fine !
I have another little request ;)
I’m using WPML, how can I make ‘Show all’ translatable ?Thank you very much for your help and your great job !
Regards.November 14, 2016 at 2:52 pm #711979Hi!
Please change the last code Ismael posted to following one
add_action('woocommerce_before_shop_loop', 'ava_show_all_product_mod', 10, 1); function ava_show_all_product_mod($post) { global $post; $per_page = get_option('avia_woocommerce_product_count'); $url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" . avia_woo_build_query_string($params, 'product_count', $per_page * 50); unset($_SESSION['product_count']); session_destroy(); echo "<a href='{$url}' class='all_product'>".__('Show All','avia_framework')."</a>"; }
Cheers!
YigitNovember 14, 2016 at 5:12 pm #712078Thank you very much !
Regards,
ThibaultNovember 14, 2016 at 5:19 pm #712081Hi!
You are welcome! Glad Ismael could help :)
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Regards,
Yigit -
AuthorPosts
- The topic ‘Create a show all button in archive products page’ is closed to new replies.