Documentation/PayPal Express Checkout Payment Gateway for WooCommerce/How to have a PayPal Express button on a custom page

How to have a PayPal Express button on a custom page

By default, the PayPal Express Checkout payment gateway for WooCommerce plugin will allow you to add a PayPal express button within the product, cart, and checkout page.

However, you may want to have these payment buttons within any custom page. This can be achieved by inserting the below-given shortcode in the concerned page.

Shortcode

The shortcode for adding PayPal express button for simple products can be given in the following manner:

[eh-express-button product_id="product id" quantity="number of quantity"]

The “product_id” and the “number of products” specified in the shortcode must be replaced with the actual product id and quantity of the product while using it on your custom page.

The shortcode for adding PayPal express button for variable products can be given in the following manner:

[eh-express-button product_id="product id" quantity="number of quantity" variation_id="variation id"]

The “product_id”, “number of products” and the “variation id” specified in the shortcode must be replaced with the actual product id and quantity of the product and variation id while using it on your custom page.

Sample demo

You can insert the shortcode, assign it with the respective product id and parameters in the following manner to have a PayPal checkout button on a custom page.

Shortcode for PayPal checkout button
Shortcode for PayPal checkout button
  • Was this article helpful?
  • YesNo