Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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,
    Thibault

    #708550

    Hey 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,
    Ismael

    #708664

    Hi 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,
    Thibault

    #709327

    Hi,

    Please change “1000” to “9” in that case

    Best regards,
    Yigit

    #709351

    Sorry 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 !
    regards

    #710546

    Hi!

    How can we change the category? I’m probably missing something because I don’t understand the language. A screenshot will help.

    Regards,
    Ismael

    #710616

    Hi,
    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 !
    Regards

    #711791

    Hi!

    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,
    Ismael

    #711859

    Thank 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.

    #711979

    Hi!

    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!
    Yigit

    #712078

    Thank you very much !
    Regards,
    Thibault

    #712081

    Hi!

    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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Create a show all button in archive products page’ is closed to new replies.