TI WooCommerce Wishlist Shortcodes

Below, you’ll find a detailed guide on how to add the TI WooCommerce Wishlist Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the TI WooCommerce Wishlist Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the TI WooCommerce Wishlist Plugin and the shortcodes it provides:

Plugin Icon
TI WooCommerce Wishlist

"TI WooCommerce Wishlist is a powerful plugin that enables your customers to save their favorite items for later purchase. It enhances user experience and boosts sales on your WooCommerce store."

★★★★☆ (410) Active Installs: 100000+ Tested with: 6.2.3 PHP Version: 7.4
Included Shortcodes:
  • [ti_wishlists_addtowishlist]
  • [ti_wishlistsview]
  • [ti_wishlist_products_counter]

TI WooCommerce Wishlist [ti_wishlists_addtowishlist] Shortcode

The ‘ti_wishlists_addtowishlist’ shortcode is part of the TI WooCommerce Wishlist plugin. It allows users to add items to their wishlist directly. This shortcode calls the ‘tinvwl_shortcode_addtowishlist’ function. It returns a class instance that handles the addition of items to the wishlist.

Shortcode: [ti_wishlists_addtowishlist]

Examples and Usage

Basic example – The following shortcode is a simple usage of the ‘ti_wishlists_addtowishlist’ shortcode without any additional parameters. It will add a default ‘Add to Wishlist’ button to your WordPress WooCommerce store.

[ti_wishlists_addtowishlist]

PHP Function Code

In case you have difficulties debugging what causing issues with [ti_wishlists_addtowishlist] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'ti_wishlists_addtowishlist', 'tinvwl_shortcode_addtowishlist' );

Shortcode PHP function:

function tinvwl_shortcode_addtowishlist( $atts = array() ) {
		$class = TInvWL_Public_AddToWishlist::instance();

		return $class->shortcode( $atts );
	}

Code file location:

ti-woocommerce-wishlist/ti-woocommerce-wishlist/tinv-wishlists-function.php

TI WooCommerce Wishlist [ti_wishlistsview] Shortcode

The ‘ti_wishlistsview’ shortcode is a part of the ti-woocommerce-wishlist plugin. It enables users to view their wishlist items on a WordPress site. The PHP function ‘tinvwl_shortcode_view’ is called when this shortcode is used. It returns a list of wishlist items, allowing for a personalized user experience.

Shortcode: [ti_wishlistsview]

Examples and Usage

Basic example – The below shortcode will display the wishlist view by referencing the wishlist ID. If the ID is not provided, it will display the default wishlist.

[ti_wishlistsview id=1 /]

Advanced examples

In the following example, the shortcode is used to display the wishlist view with a specific ID and title. If the wishlist with the provided ID is not found, it will try to display the wishlist with the provided title.

[ti_wishlistsview id=1 title="My Wishlist" /]

In this next advanced example, the shortcode is used to display the wishlist view with a specific ID and it will also set the ‘show_title’ attribute to ‘yes’. This will display the title of the wishlist along with the wishlist view.

[ti_wishlistsview id=1 show_title="yes" /]

In the final advanced example, the shortcode is used to display the wishlist view with a specific ID, it will set the ‘show_title’ attribute to ‘yes’, and it will also set the ‘show_count’ attribute to ‘yes’. This will display the title of the wishlist, the wishlist view, and the count of items in the wishlist.

[ti_wishlistsview id=1 show_title="yes" show_count="yes" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [ti_wishlistsview] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'ti_wishlistsview', 'tinvwl_shortcode_view' );

Shortcode PHP function:

function tinvwl_shortcode_view( $atts = array() ) {
		$class = TInvWL_Public_Wishlist_View::instance();

		return $class->shortcode( $atts );
	}

Code file location:

ti-woocommerce-wishlist/ti-woocommerce-wishlist/tinv-wishlists-function.php

TI WooCommerce Wishlist [ti_wishlist_products_counter] Shortcode

The ‘ti_wishlist_products_counter’ shortcode is a feature of the ti-woocommerce-wishlist plugin. It displays the total count of products added to the user’s wishlist. The associated PHP function, ‘tinvwl_shortcode_products_counter’, retrieves the product count data and returns it for display.

Shortcode: [ti_wishlist_products_counter]

Examples and Usage

Basic example – A simple usage of the ‘ti_wishlist_products_counter’ shortcode without any additional parameters.

[ti_wishlist_products_counter]

PHP Function Code

In case you have difficulties debugging what causing issues with [ti_wishlist_products_counter] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'ti_wishlist_products_counter', 'tinvwl_shortcode_products_counter' );

Shortcode PHP function:

function tinvwl_shortcode_products_counter( $atts = array() ) {
		$class = TInvWL_Public_WishlistCounter::instance();

		return $class->shortcode( $atts );
	}

Code file location:

ti-woocommerce-wishlist/ti-woocommerce-wishlist/tinv-wishlists-function.php

Conclusion

Now that you’ve learned how to embed the TI WooCommerce Wishlist Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *