Country Based Restrictions for WooCommerce Shortcode

Below, you’ll find a detailed guide on how to add the Country Based Restrictions 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 Country Based Restrictions for WooCommerce Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Country Based Restrictions for WooCommerce Plugin and the shortcodes it provides:

Plugin Icon
Country Based Restrictions for WooCommerce

"Country Based Restrictions for WooCommerce is a useful plugin that enables eCommerce businesses to apply country-specific limitations on product availability, providing a more tailored shopping experience."

★★★★☆ (46) Active Installs: 5000+ Tested with: 6.0.6 PHP Version: 7.0
Included Shortcodes:
  • [cbr_message_position]

Country Based Restrictions for WooCommerce [cbr_message_position] Shortcode

The CBR Message Position shortcode is a function in the woo-product-country-base-restrictions plugin. It displays a specific message based on the user’s location. This shortcode starts an output buffer, calls the meta area message function, and then returns the content of the buffer.

Shortcode: [cbr_message_position]

Examples and Usage

Basic example – The following shortcode allows you to display a message in a specific position on your woo-product page using the ‘cbr_message_position’ shortcode.

[cbr_message_position /]

PHP Function Code

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

Shortcode line:

add_shortcode('cbr_message_position', array( $this, 'cbr_message_position_func') );

Shortcode PHP function:

function cbr_message_position_func() {
		ob_start();
		$this->meta_area_message();
  		return ob_get_clean();
	}

Code file location:

woo-product-country-base-restrictions/woo-product-country-base-restrictions/include/products-restriction.php

Conclusion

Now that you’ve learned how to embed the Country Based Restrictions 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 *