Skip to content
Addonify

Addonify

Documentation & knowledge based site

  • Docs
    • Quick View
    • Compare Products
    • Floating Cart
    • EDD 2Checkout Inline Gateway
  • Plugins
  • Themes
  • Support
  • Blog
Addonify store
  • Docs
    • Quick View
    • Compare Products
    • Floating Cart
    • EDD 2Checkout Inline Gateway
  • Plugins
  • Themes
  • Support
  • Blog

Getting started [2]

  • Installation
  • Access Setting Page

Developer [4]

  • Using Hooks
  • Overwriting Templates
  • Useful Functions
  • Custom Add to Wishlist Button

Support [3]

  • Support & Discussion
  • Dealing with the cache plugins
  • Changelog
  • Home
  • Kb
  • WooCommerce Wishlist
  • Developer
  • Custom Add to Wishlist Button

Custom Add to Wishlist Button

  • Updated on: October 17, 2023

Addonify Wishlist also supports custom add to wishlist button. Below is the markup of the custom add to wishlist button:

<button class="adfy-wishlist-btn addonify-add-to-wishlist-btn addonify-custom-wishlist-btn" data-product_id="{product_id}" data-product_name="{product_name}">{button_label}</button>

You can add custom CSS classes, but addonify-add-to-wishlist-btn is a necessary CSS class that is used to fire the add to wishlist functionality.

You also need to set WooCommerce product ID in the attribute data-product_id and WooCommerce product name in the attribute data-product_name.

You can have your own button label. But if you wish to have the button label from the Addonify Wishlist plugin’s setting page, use the code below:

addonify_wishlist_get_button_label( $in_wishlist = false )

You can also use the shortcode [addonify_wishlist_button] to add a custom add to wishlist button. The attributes that can be used in the shortcode are as follow:

  • product_id: Product’s id
  • button_label: Add to wishlist button label.
  • added_to_wishlist_button_label: Added to wishlist button label.
  • already_in_wishlist_button_label: Already in wishlist button label.
  • classes: Button CSS classes.
  • button_icon_position: Icon position, ‘none’, ‘left’, and ‘right’.

Didn't find what you looking for? Try sending your questions from our contact page.

Your feedback matters to us. Was this article helpful to you?

2 2

Copyright © 2022 addonify.com. All rights reserved.

Project by 💖 CreamCode.Org