Discover now all features of YITH WooCommerce Wishlist and purchase now!

DISCOVER NOW the plugin features

YITH WooCommerce Wishlist Documentation

Wishlist Shortcode

YITH Add to Wishlist

The shortcode "[yith_wcwl_add_to_wishlist]" loads the content of the "add-to-wishlist.php" template (the file is in the "templates" folder of the plugin), and prints the "Add To Wishlist" button in the front end.
Shortcode attributes are:

  • 'wishlist_url': (string) the URL of the page that contains the wishlist; it is showed only if the product is already in the wishlist.
  • 'exists': (boolean) it states if the product is already in the wishlist.
  • 'product_id': (int) the ID of the product to add to the wishlist with the button.
  • 'product_type': (string) it can takes the values simple, variable or grouped depending of the product type (the default value is simple).
  • 'label': (string) the label to show inside the button.
  • 'browse_wishlist_text': (string) the label of the button that redirects to the wishlist. This is showed when the product is already in the wishlist.
  • 'already_in_wishslist_text': (string) the label showed when the product is already in the wishlist.
  • 'product_added_text': (string) the "product added" label, which is showed when a product is added to the wishlist.
  • 'icon': (string) the icon to show in the button (selected among the ones of font-awesome).
  • 'link_classes': (string) possible classes that can be added to the button. If it is a real button, the default class is "add_to_wishlist single_add_to_wishlist button alt", if on the contrary is plain text, the default class is "add_to_wishlist"."
  • 'available_multi_wishlist': (boolean) it states whether the multiwishlist feature is enabled.

YITH Wishlist Table

Shortcode "[yith_wcwl_wishlist]" loads the content of the "wishlist.php" template (the file is in the "templates" folder of the plugin), to make appear the wishlist in the page.
Shortcode attributes:

  • 'per_page': (int) the number of elements per page (the default value is 5).
  • 'pagination': (string: yes/no) it sets whether to paginate the wishlist; in case this parameter is set to "no", the attribute "per page" will not be considered.