Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2939569
How to add the wishlist counter to my menu
Open

Comments

  •  2
    Luzi Stadler started the conversation

    Hello Support-Team

    I wondering how i can add the wishlist heart icon and the wishlist counter to my menu? Is there a shortcode?

  •  767
    Janilyn replied

    Hi Luzi,

    Thank you for contacting WPClever Support Forum. 

    We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. 

    Please stay patient as we're having very heavy workloads, it might take some time for our developers to reach back.

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,226
    Dustin replied

    Hi Luzi,

    Please add the below custom code (How to add custom code?)

    add_shortcode( 'woosw_header', 'woosw_header_shortcode' );
    function woosw_header_shortcode() {
        ob_start();
        if ( class_exists( 'WPCleverWoosw' ) ) {
            ?>
            <div class="site-header-wishlist">
                <a class="header-wishlist" href="<?php echo esc_url( WPCleverWoosw::get_url() ); ?>">
                    <span class="count"><?php echo esc_html( WPCleverWoosw::get_count() ); ?></span>
                </a>
            </div>
            <?php
        }
        return ob_get_clean();
    }

    Then you can place the shortcode [woosw_header] where you want and also can style for this button.

    If you want to place the wishlist icon and counter on a specific site, let me know then I can do the example for you.

    In this case, please send me your website credentials (wp-admin link, username, password). You also can create a dev/staging site with the same configurations then I'll work on it.

    Best regards,
    Dustin

  • Julia A replied

    Hello!

    I have a problem with the solution you provided with the custom code.

    When I add the code to the header it works and display the number of products in the wishlist but if I add one more product the counter doesn't work and I need to update the page to see the current number. Do you have the solution how to fix it?

    Thank you!