Wishlist Shortcodes

The WCBoost – Wishlist plugin provides two powerful shortcodes to help you integrate wishlist functionality into your WooCommerce store. These shortcodes allow you to display the wishlist content and add wishlist buttons to your products easily.

1. Wishlist page shortcode

This shortcode is used to display the list of products in the customer’s wishlist.

Usage

Simply add the following shortcode to your Wishlist page:

[wcboost_wishlist]

Features

  • Displays all products currently in the user’s wishlist
  • Shows product images, names, prices, and any available variations
  • Allows users to remove items from their wishlist
  • Provides an “Add to Cart” button for each product

Notes

  • This shortcode doesn’t support any attributes at the moment.
  • It’s recommended to use this shortcode on a dedicated Wishlist page.

2. Wishlist button shortcode

This shortcode is used to display the wishlist button for a specific product.

Usage

You can use this shortcode in your product templates or on custom pages where you want to display a wishlist button:

[wcboost_wishlist_button]

Attributes

This shortcode accepts one optional attribute:

  • product_id: Specifies the ID of the product to be added to the wishlist.

Example with product_id

[wcboost_wishlist_button product_id="123"]

This will display the wishlist button for the product with ID 123.

Features

  • Adds a wishlist button to any product
  • When clicked, adds the product to the user’s wishlist
  • Can be customized to work with specific products using the product_id attribute

Notes

  • If no product_id is specified, the shortcode will attempt to use the current product ID (useful when used within product templates).
  • The appearance of the button can be customized through the plugin settings or with custom CSS.

Implementation Tips

  1. Wishlist Page: Create a new page for your wishlist and add the [wcboost_wishlist] shortcode to display the wishlist contents.
  2. Product Pages: The wishlist button is usually added automatically to product pages. If you need to add it manually, you can use the [wcboost_wishlist_button] shortcode in your product template.
  3. Custom Layouts: Use the [wcboost_wishlist_button] shortcode with the product_id attribute to add wishlist buttons to custom product layouts or grids.
  4. Widget Areas: You can also use these shortcodes in text widgets to add wishlist functionality to your sidebar or footer areas.

Remember to test the shortcodes after implementation to ensure they’re working as expected with your theme and other plugins.