Below, you’ll find a detailed guide on how to add the Razorpay Quick Payments 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 Razorpay Quick Payments Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Razorpay Quick Payments Plugin and the shortcodes it provides:
"Razorpay Quick Payments is a seamless WordPress plugin enabling quick, secure transactions. This tool integrates Razorpay payment gateway into your site, simplifying online payments."
- [RZP]
Razorpay Quick Payments [RZP] Shortcode
The Razorpay Quick Payments plugin shortcode, ‘RZP’, initiates the checkout process. It generates the Razorpay order form, enabling seamless transactions.
Shortcode: [RZP]
Examples and Usage
Basic example – The shortcode is utilized to checkout with Razorpay. It generates the Razorpay order form without any additional parameters.
[RZP /]
Advanced examples
Additional parameters can be used with the shortcode to customize the Razorpay checkout process. Here are a few examples:
Using the shortcode to checkout with a specific order ID. This will generate a Razorpay order form for the specified order.
[RZP order_id="1234" /]
Using the shortcode to checkout with a specific product. This will generate a Razorpay order form for the specified product.
[RZP product_id="5678" /]
Using the shortcode to checkout with a specific product and a specific order. This will generate a Razorpay order form for the specified product and order.
[RZP product_id="5678" order_id="1234" /]
PHP Function Code
In case you have difficulties debugging what causing issues with [RZP]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('RZP', array($this, 'checkout'));
Shortcode PHP function:
function checkout()
{
$html = $this->generateRazorpayOrderForm();
return $html;
}
Code file location:
razorpay-quick-payments/razorpay-quick-payments/razorpay-quick-payments.php
Conclusion
Now that you’ve learned how to embed the Razorpay Quick Payments 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