Below, you’ll find a detailed guide on how to add the WooCommerce Tools 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 WooCommerce Tools Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the WooCommerce Tools Plugin and the shortcodes it provides:
"WooCommerce Tools is a dynamic WordPress plugin that enhances your eCommerce platform. It provides a suite of tools to streamline your WooCommerce store, improving functionality and user experience."
- [tfwc_tool_compare_button]
- [tfwc_tool_compare_list]
- [tfwc_tool_wishlist]
WooCommerce Tools [tfwc_tool_compare_button] Shortcode
The TFWC Tool Compare Button shortcode is a powerful tool in the woo-tools plugin. It triggers a function that outputs a compare button on your WooCommerce site. This button, defined in the ‘compare-button.php’ template, allows users to compare different products, enhancing the shopping experience.
Shortcode: [tfwc_tool_compare_button]
Examples and Usage
Basic example – Displays the compare button without any additional parameters.
[tfwc_tool_compare_button /]
PHP Function Code
In case you have difficulties debugging what causing issues with [tfwc_tool_compare_button]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('tfwc_tool_compare_button', array($this, 'button_shortcode'));
Shortcode PHP function:
function button_shortcode($atts, $contnet) {
ob_start();
tfwctool_get_template('compare-button.php', $this->button_args);
$button_html = ob_get_clean();
return $button_html;
}
Code file location:
woo-tools/woo-tools/modules/compare/php/class-compare.php
WooCommerce Tools [tfwc_tool_compare_list] Shortcode
The TFWC Tool Compare List shortcode is a powerful tool from WooCommerce. It provides a simple way to display a comparison list on your site. This shortcode calls a function that triggers TFWC_TOOL_Compare to show a comparison list. It’s a handy tool for product comparison, enhancing user experience.
Shortcode: [tfwc_tool_compare_list]
Examples and Usage
Basic example – A simple usage of the ‘tfwc_tool_compare_list’ shortcode without any parameters.
[tfwc_tool_compare_list /]
PHP Function Code
In case you have difficulties debugging what causing issues with [tfwc_tool_compare_list]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('tfwc_tool_compare_list', 'woocommerce_tool_compare_list_shortcode');
Shortcode PHP function:
function woocommerce_tool_compare_list_shortcode($atts){
TFWC_TOOL_Compare()->show_compare_list();
}
Code file location:
woo-tools/woo-tools/modules/compare/php/compare-shortcode.php
WooCommerce Tools [tfwc_tool_wishlist] Shortcode
The TFWC_Tool_Wishlist shortcode is a dynamic tool in the Woocommerce plugin that allows users to create and manage wishlists. This shortcode initiates an instance of the wishlist, prints it on the page, and returns the output. It simplifies wishlist management for users, enhancing their shopping experience.
Shortcode: [tfwc_tool_wishlist]
Examples and Usage
Basic example – A simple usage of the ‘tfwc_tool_wishilst’ shortcode without any additional parameters.
[tfwc_tool_wishilst /]
PHP Function Code
In case you have difficulties debugging what causing issues with [tfwc_tool_wishlist]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('tfwc_tool_wishilst', 'woocommerce_tool_wishlist_shortcode');
Shortcode PHP function:
function woocommerce_tool_wishlist_shortcode($atts) {
$wishlist = TFWC_TOOL_Wishilst::get_instance();
ob_start();
$wishlist->print_wishlist();
return ob_get_clean();
// $wishlist->send_wishlist_over_ajax();
}
Code file location:
woo-tools/woo-tools/modules/wishlist/php/wishlist-shortcode.php
Conclusion
Now that you’ve learned how to embed the WooCommerce Tools 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.
Leave a Reply