We previously spoke about how the default product shortcode of each of your WP Express Checkout products can be pasted onto a WordPress page or a post to display a purchase button. While using the basic shortcode allows you to add your product button to your website, you can add a ‘template‘ parameter to this shortcode to alter the way the product and button is shown on the front end of your website. The template options are a nice way of displaying a product box with details, a thumbnail image, the price of the product and the important PayPal purchase button.
Why Should I Use a Template Display Shortcode to Embed a Product?
Many use the ‘template’ parameter within their product shortcode as this outputs an aesthetically pleasing product that can include the description, thumbnail, price, and purchase button. If you have multiple products that you wish to display on a single page, using template=”1″ will allow you to display them all neatly so that your customers can easily distinguish between the products you offer.
Displaying a Product with Template 1
Once you have created a product you can use the following template shortcode, to display your product and a ‘Buy Now’ button on any WordPress post or page. This style is known as ‘Template 1“. This template will display your product’s title, description, thumbnail image, price, and purchase button.
Template 1 Product Shortcode:
[wp_express_checkout product_id="Your Product ID" template="1"]
You will need to locate the ID of your product from the ‘WP Express Checkout‘ ‘Products‘ page, and then add this to the shortcode above. Once you view the page or post you have added this shortcode to, you will see your product displayed similar to the product below:
If you wish to display multiple template 1 shortcodes on a single page, using the WordPress column block inserter is a nice way of doing so. In the following screenshot we have added two products side-by-side using the ‘two-column’ option and the template 1 product shortcode: