• Resolved huzi7868

    (@huzi7868)


    Hello and thanks in advance for the help.

    Looking at the yith wishlist plugin on the YITH website, i noticed that you have use icons to add to wishlist. After some time and effort playing around with CSS i noticed that the option to use an icon is included as custom!! Thats a cool feature.

    However there is an issue for me. When i click on the icon to add to wishlist, it works fine but then ‘text’ appears saying browse wishlist.

    This changes the width of the div and causes some issues with my centering. I would like something like the yith plugin theme demo has. The add to wishlist hear is lets say white, and when the product is added it turns red. Cliking on it takes you to the wishlist page.

    MY question, you have an option for “Add to Wishlist” icon but what about “Browse Wishlist” icon?

    https://wordpress.org/plugins/yith-woocommerce-wishlist/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter huzi7868

    (@huzi7868)

    Might i add that i have very little coding experience, and what i do have is limited to hTML and CSS

    Plugin Author YITHEMES

    (@yithemes)

    Hi huzi7868,

    I think the best solution for your problem is to overwrite in your theme the add-to-wishlist.php template.

    Simply copy wp-content/plugins/yith-woocommerce-wishlist-premium/templates/add-to-wishlist.php and paste it in your theme root; then customize yith-wcwl-wishlistaddedbrowse and yith-wcwl-wishlistexistsbrowse to show the icon

    For example, you can use this php snippet

    <?php echo $icon ?>

    to print icon selected in admin panel for “Add to wishlist button”, as this

    <div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;">
        <a href="<?php echo esc_url( $wishlist_url )?>" >
            <?php echo $icon ?>
        </a>
    </div>
    
    <div class="yith-wcwl-wishlistexistsbrowse <?php echo ( $exists && ! $available_multi_wishlist ) ? 'show' : 'hide' ?>" style="display:<?php echo ( $exists && ! $available_multi_wishlist ) ? 'block' : 'none' ?>">
        <a href="<?php echo esc_url( $wishlist_url ) ?>">
            <?php echo $icon ?>
        </a>
    </div>

    Now you can customize the previous divs as you wish in your css

    Let me know if this helps
    Have a nice day 🙂

    Thread Starter huzi7868

    (@huzi7868)

    IS there a way for me to set the icon to be different when already added?

    <?php echo $icon ?> and add the actual icon into the code (fore example heart) instead of it loading the add to wishlist icon

    Plugin Author YITHEMES

    (@yithemes)

    Hi again 🙂

    Uhm… if you want to use a different icon, maybe it’s better leave $icon variable alone, and use a custom icon template, like this

    <i class="fa fa-YOUR_ICON_CLASS"></i>

    So, the template could be something like this

    <div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;">
        <a href="<?php echo esc_url( $wishlist_url )?>" >
            <i class="fa fa-YOUR_ICON_CLASS"></i>
        </a>
    </div>
    
    <div class="yith-wcwl-wishlistexistsbrowse <?php echo ( $exists && ! $available_multi_wishlist ) ? 'show' : 'hide' ?>" style="display:<?php echo ( $exists && ! $available_multi_wishlist ) ? 'block' : 'none' ?>">
        <a href="<?php echo esc_url( $wishlist_url ) ?>">
            <i class="fa fa-YOUR_ICON_CLASS"></i>
        </a>
    </div>

    To check all available font-awesome icon class, check this url

    Let me know if this helps
    Have a nice day 🙂

    Thread Starter huzi7868

    (@huzi7868)

    That works perfectly. Thank you so very much

    Thread Starter huzi7868

    (@huzi7868)

    Will mark as resolved.

    Plugin Author YITHEMES

    (@yithemes)

    Glad to hear that!

    Thanks for using our plugin. If you have appreciated our plugin and our help, please don’t forget to give us a 5-star vote! 😉

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Browse Wishlist icon’ is closed to new replies.