Pronamic Pay Shortcode

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

Before starting, here is an overview of the Pronamic Pay Plugin and the shortcodes it provides:

Plugin Icon
Pronamic Pay

"Pronamic Pay is a powerful WordPress plugin that facilitates seamless online payments. With its user-friendly interface, it simplifies transactions, making it ideal for e-commerce sites."

★★★★☆ (83) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: 7.4
Included Shortcodes:
  • [pronamic_payment_form]

Pronamic Pay [pronamic_payment_form] Shortcode

The Pronamic Pay plugin shortcode is designed to generate a specific payment form on your WordPress site. This shortcode takes an ‘id’ as its attribute, which corresponds to the unique ID of the payment form you wish to display. If the ‘id’ is not provided or is invalid, it will return an empty string. Otherwise, it will return the HTML output of the specified payment form.

Shortcode: [pronamic_payment_form]

Parameters

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

  • id – It’s the unique identifier of the payment form.

Examples and Usage

Basic Example – This shortcode is used to render a payment form with the specified ID.

[pronamic_payment_form id=1 /]

Advanced Examples

Here, we are using the shortcode to display a payment form by referencing the ID. If the ID is not found, the shortcode will return an empty string.

[pronamic_payment_form id=2 /]

In the following example, we are passing an invalid ID to the shortcode. In this case, the shortcode will return an empty string because the payment form with the specified ID does not exist.

[pronamic_payment_form id=999 /]

Please note that the ID you pass to the shortcode should correspond to an existing payment form in your Pronamic Pay plugin. If you pass an ID that does not correspond to an existing form, the shortcode will not be able to render the form.

PHP Function Code

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

Shortcode line:

add_shortcode( 'pronamic_payment_form', [ $this, 'shortcode_form' ] );

Shortcode PHP function:

function shortcode_form( $atts ) {
		$atts = shortcode_atts(
			[
				'id' => null,
			],
			$atts,
			'pronamic_payment_form'
		);

		if ( empty( $atts['id'] ) ) {
			return '';
		}

		return $this->integration->get_form_output_by_id( (int) $atts['id'] );
	}

Code file location:

pronamic-ideal/pronamic-ideal/packages/pronamic/wp-pronamic-pay-forms/src/FormShortcode.php

Conclusion

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