Join the Soledad Facebook Users Group here
for Share, assistance, discussion, and Updates related to Soledad WordPress Theme.

If you can't create a new ticket - you can send us an email via our contact form and we will get back to you.

Okay
  Public Ticket #3025185
check if wishlist contains products
Closed

Comments

  • daniel_ghre started the conversation

    Hello, I would like to know if there is a way to know if the wishlist is empty or not (by code) because I would like to present a form below if the wishlist is not empty. Thanks

  •  2,490
    PenciDesign replied

    Hi,

    You can use the following functions to check the wishlist & compare items:

    function get_total_product_compare(){
        ob_start();
        do_action( 'penci_current_compare' );
        $compare = ob_get_contents();
        ob_end_clean();
        return $compare;
    }
    function get_total_product_wishlist(){
        ob_start();
        do_action( 'penci_current_wishlist' );
        $wishlist = ob_get_contents();
        ob_end_clean();
        return $wishlist;
    }

    Regards,
    PenciDesign.



  •   daniel_ghre replied privately
  •   PenciDesign replied privately
  • daniel_ghre replied

    Still not working, total is 0 even if I add products in the wishlist :(

  •  2,490
    PenciDesign replied

    Hi,

    All the code I've sent working properly on my local devices.

    Please check your code again or send me a code you're currently using.

    Regards,
    PenciDesign.


  •   daniel_ghre replied privately
  •  2,490
    PenciDesign replied

    Hi,

    I've created an example for you here:

    4xOr4jl.png

    The code is located here: https://www.madeli.fr/wp-admin/admin.php?page=edit-snippet&id=7&result=updated

    Regards,
    PenciDesign.



  • daniel_ghre replied

    Thanks it works ! :)

    Do you have a hook to put a shortcut just below the wishlist ? Thanks 

  •  2,490
    PenciDesign replied

    Hi,

    Unfortunately, the current version of Soledad doesn't support a hook after the wishlist products, but you can do it after the [penci_wishlist] shortcode.

    Regards,
    PenciDesign.


  • daniel_ghre replied

    How to put it after the [penci_wishlist] shortcode ? 

  •  2,490
    PenciDesign replied

    Hi,

    Please add it to the page you've set as a wishlist.

    Regards,
    PenciDesign.