1. Documentation
  2. Purchases
  3. [gamipress_points_purchase]

[gamipress_points_purchase]

Render a points purchase form.

This shortcode accepts different attributes based on the form_type attribute value.

Important: Remember that to work with a desired points type, is required to configure the conversion rate of the points type used.

Common Attributes:

  • points_type – The points type to be purchased. Accepts: any slug of any points type registered.
  • form_type – The purchase form type. Accepts: fixed, custom, options Default: fixed
  • amount_type – The amount type to work with. Accepts: points, money Default: points
  • getaways – Choose the payment methods customer can use. Accepts: all, bank_transfer or paypal_standard Default: all
  • acceptance – Add a required acceptance checkbox (important to meet with GDPR). Accepts: yes or no Default: yes
  • acceptance_text – Text to show for the required acceptance checkbox. Default: I consent to the collection of data provided above
  • button_text – Purchase button text. Default: Purchase

Fixed amount form (form_type=”fixed”)

User will see a points purchase form with the configured amount (without possibility to change it).
Attributes:

  • amount – Amount user will purchase (based on the amount type).

Example using points:
[gamipress_points_purchase points_type="credits" form_type="fixed" amount_type="points" amount="1000" button_text="Purchase"]

Example using money:
[gamipress_points_purchase points_type="credits" form_type="fixed" amount_type="money" amount="10" button_text="Purchase"]

Custom amount form (form_type=”custom”)

User will see a points purchase form where he can configure the desired amount of points to purchase. If amount_type is set to money, then user will enter the money he wants expend.

Every time user changes the amount, the form totals will change without refresh the page.
Attributes:

  • initial_amount – Set the initial amount.

Example using points:
[gamipress_points_purchase points_type="credits" form_type="custom" amount_type="points" initial_amount="1000" button_text="Purchase"]

Example using money:
[gamipress_points_purchase points_type="credits" form_type="custom" amount_type="money" initial_amount="10" button_text="Purchase"]

Options form (form_type=”options”)

User will see a points purchase form where he can choose an amount of points to purchase. If amount_type is set to money, then options will show money to let user decide how much expend.

If you set the attribute allow_user_input to yes, then a new option will be shown to let to the user enter a custom amount (like custom amount form).

Every time user changes the amount, the form totals will change without refresh the page.
Attributes:

  • options – Options available to purchase.
  • allow_user_input – Check this option to allow user input a custom amount. Default: yes
  • initial_amount – Set the initial amount if allow_user_input is set to yes.

Example using points:
[gamipress_points_purchase points_type="credits" form_type="options" amount_type="points" options="100,500,1000" allow_user_input="yes" initial_amount="1000" button_text="Purchase"]

Example using money:
[gamipress_points_purchase points_type="credits" form_type="options" amount_type="money" options="5,10,15" allow_user_input="yes" initial_amount="15" button_text="Purchase"]

Was this article helpful to you? Yes No

How can we help?