Product Size Chart For WooCommerce Shortcode

Below, you’ll find a detailed guide on how to add the Product Size Chart 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 Chart For WooCommerce Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Product Size Chart For WooCommerce Plugin and the shortcodes it provides:

Plugin Icon
Product Size Chart For WooCommerce

"Product Size Chart For WooCommerce is an invaluable tool for e-commerce websites. It simplifies online shopping by providing clear, size-specific details for products, enhancing customer experience."

★★★★☆ (25) Active Installs: 4000+ Tested with: 6.2.3 PHP Version: 7.0
Included Shortcodes:
  • [PSCW_SIZE_CHART]

Product Size Chart For WooCommerce [PSCW_SIZE_CHART] Shortcode

The PSCW_SIZE_CHART shortcode is used to display a product size chart on your WooCommerce website. It extracts the chart data associated with the specified ‘id’. This shortcode enqueues the necessary CSS styles and handles the data extraction. If no ‘id’ is provided, it returns an empty string.

Shortcode: [PSCW_SIZE_CHART]

Parameters

Here is a list of all possible PSCW_SIZE_CHART shortcode parameters and attributes:

  • id – unique identifier of the product size chart

Examples and Usage

Basic example – A simple usage of the shortcode to display a size chart by referencing its ID.

[PSCW_SIZE_CHART id=1 /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'PSCW_SIZE_CHART', [ $this, 'short_code_content' ] );

Shortcode PHP function:

function short_code_content( $atts ) {
			$this->woo_sc_function = new PSCW_PRODUCT_SIZE_CHART_F_WOO_Function();
			wp_enqueue_style( 'woo_sc_product_size_chart_css', PSCW_SIZE_CHART_PLUGIN_URL . 'css/sizechart_frontend_css.css', '', PSCW_SIZE_CHART_VERSION );
			wp_register_style( 'woo_table_style', false );
			$atts = shortcode_atts( array( 'id' => '' ), $atts );
			if ( ! $atts['id'] ) {
				return '';
			}
			$result = $this->woo_sc_function->content_data( $atts['id'] );

			return $result;
		}

Code file location:

product-size-chart-for-woo/product-size-chart-for-woo/admin/design-new.php

Conclusion

Now that you’ve learned how to embed the Product Size Chart 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.

Comments

Leave a Reply

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