Order Tip for WooCommerce Shortcode

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

Before starting, here is an overview of the Order Tip for WooCommerce Plugin and the shortcodes it provides:

Plugin Icon
Order Tip for WooCommerce

"Order Tip for WooCommerce is a handy plugin that allows customers to add a tip to their orders. It seamlessly integrates with your WooCommerce store, enhancing customer experience."

★★★★☆ (13) Active Installs: 3000+ Tested with: 6.1.4 PHP Version: false
Included Shortcodes:
  • [order_tip_form]

Order Tip for WooCommerce [order_tip_form] Shortcode

The Order Tip Woo plugin shortcode, ‘order_tip_form’, is designed to generate a tipping form on your website. It calls the ‘tip_form()’ function when used. This function returns a tip form, allowing users to add tips to their orders. It’s a simple yet effective way to facilitate gratuities on your WooCommerce site.

Shortcode: [order_tip_form]

Examples and Usage

Basic example – Displays the order tip form on any page or post where this shortcode is placed.

[order_tip_form /]

Advanced examples

In this example, the shortcode is used with the ‘amount’ and ‘currency’ attributes. ‘amount’ is the default tip amount that will be pre-filled in the form, and ‘currency’ is the currency in which the tip will be displayed. If not provided, the default values from the plugin settings will be used.

[order_tip_form amount=10 currency="USD" /]

In the next example, the ‘order_id’ attribute is added. This attribute allows to associate the tip with a specific order. The ‘order_id’ should be a valid order ID. If not provided, the order ID will be taken from the current session (if available).

[order_tip_form amount=10 currency="USD" order_id=123 /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'order_tip_form', array( $this, 'tip_form_shortcode' ) );

Shortcode PHP function:

                    function tip_form_shortcode() {

        return $this->tip_form();

    }
                    

Code file location:

order-tip-woo/order-tip-woo/frontend/controllers/main.class.php

Conclusion

Now that you’ve learned how to embed the Order Tip 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 *