Below, you’ll find a detailed guide on how to add the Product Size Charts for WooCommerce Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Product Size Charts for WooCommerce Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Product Size Charts for WooCommerce Plugin and the shortcodes it provides:
"Product Size Charts Plugin for WooCommerce is a useful tool that allows you to create and display detailed size charts for your WooCommerce products, enhancing your customers' shopping experience."
- [scfw_product_size_chart]
Product Size Charts for WooCommerce [scfw_product_size_chart] Shortcode
The ‘scfw_product_size_chart’ shortcode is part of the Woo-Advanced-Product-Size-Chart plugin. It displays a size chart for WooCommerce products. This shortcode calls the ‘scfw_size_chart_link_shortcode’ function. This function uses output buffering to capture and return the size chart. It utilizes the ‘scfw_size_chart_popup_shortcode_callback’ function to generate the size chart.
Shortcode: [scfw_product_size_chart]
Examples and Usage
Basic example – The following shortcode displays the default size chart for Woocommerce products.
[scfw_product_size_chart]
PHP Function Code
In case you have difficulties debugging what causing issues with [scfw_product_size_chart]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'scfw_product_size_chart', 'scfw_size_chart_link_shortcode' );
Shortcode PHP function:
function scfw_size_chart_link_shortcode()
{
ob_start();
echo esc_html( SCFW_Size_Chart_For_Woocommerce_Public::scfw_size_chart_popup_shortcode_callback() ) ;
return ob_get_clean();
}
Code file location:
woo-advanced-product-size-chart/woo-advanced-product-size-chart/public/class-size-chart-for-woocommerce-public.php
Conclusion
Now that you’ve learned how to embed the Product Size Charts for WooCommerce Plugin shortcode, 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