• hi, i want to wishlist heart next to the shopping cart icon in the header, so I want to put your plugin code in part-head-shortcuts.php after this line <div class=”head-cart”> Whats your plugin code?

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,
    we hope you’re doing well!

    We have entered your site and we see that you already have the heart icon in your header. It only remains to place it where you request. In order to achieve this, add the following code in the functions.php file of your active child theme:

    if ( ! function_exists( 'yith_wcwl_move_icon_header' ) ) {
        function yith_wcwl_move_icon_header() {
            $jquery = 'jQuery( function( $ ){
                    $( "#menu-item-84850 a" ).insertAfter( ".head-cart" );
            });';
            wp_add_inline_script( 'jquery-yith-wcwl', $jquery );
            wp_add_inline_script( 'jquery-yith-wcwl-user', $jquery );
        }
        add_action( 'wp_enqueue_scripts', 'yith_wcwl_move_icon_header', 999 );
    }

    Check it out and tell us if it works well for you, please.

    Have a nice day!

    Thread Starter poesch

    (@poesch)

    hi, i’ve added it now to the menu and that looks ugly (especially on mobile)
    When i add the code you gave to functions.php i get an error. I’ve put it on the bottom of the file.

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    We have reviewed the code from the browser console, and we see it correctly in both views:

    desktop: https://we.tl/t-Zj6B1TBnsA
    mobile: https://we.tl/t-9GeRDYXieS

    Could you tell us what error appears and how you see it? Verify that you have added the code correctly, since sometimes when copying code from the code block of WordPress posts, the quotes are replaced by hexadecimal values.

    Let us know any news.

    Best regards.

    Thread Starter poesch

    (@poesch)

    Then I probably have put it in the wrong place.
    Where do I put the code in functions.php ??

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    You should place it at the end of your active theme’s functions.php file, which can usually be found in the wp-content/themes/your_active_theme/ directory.

    Check it and let us know any news.

    Best regards.

    Thread Starter poesch

    (@poesch)

    hi, I’ve added it. And I don’t see any changes.

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    In this case, we recommend you contact the support of your theme to see how to add this code in your theme, or how to move the icon to the position you want.

    Let us know any news, please.

    Best regards.

    Thread Starter poesch

    (@poesch)

    okay, but you said you tested it?

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hi there,

    We test the js code from the console of your browser, but we cannot do more than that, since it is a specific addition to your installation that we cannot replicate in ours, since it is totally different.

    Let us know any news.

    Best regards.

    Thread Starter poesch

    (@poesch)

    I’ve put your code in a php snippet plugin, but it still doesn’t work. Can’t you test it again please?

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    It seems that the identifier of the container of the wishlist element in your header has changed and that is why the code that we have provided above does not work. Replace it with the following please:

    if ( ! function_exists( 'yith_wcwl_move_icon_header' ) ) {
        function yith_wcwl_move_icon_header() {
            $jquery = 'jQuery( function( $ ){
                    $( "#menu-item-85582 a" ).insertAfter( ".head-cart" );
            });';
            wp_add_inline_script( 'jquery-yith-wcwl', $jquery );
            wp_add_inline_script( 'jquery-yith-wcwl-user', $jquery );
        }
        add_action( 'wp_enqueue_scripts', 'yith_wcwl_move_icon_header', 999 );
    }

    Let us know any news.

    Have a nice day!

    Thread Starter poesch

    (@poesch)

    Yes, that worked!!!

    Is it possible to make it a heart icon instead of the word ‘Wishlist’? The word doesn’t fit on mobile.

    Thread Starter poesch

    (@poesch)

    Do you know why it’s only visible at my Dutch website? And not on the English website?

    Thread Starter poesch

    (@poesch)

    Is it possible to make it a heart icon instead of the word ‘Wishlist’? The word doesn’t fit on mobile.

    And do you know why it’s only visible at my Dutch website?

    And not on the English website?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘wishlist heart in header’ is closed to new replies.