How to add a product sample button using shortcode on a custom product page in WooCommerce

The Product Sample plugin allows you to display a sample request button on product pages using a shortcode.

This is especially useful when you are using custom product templates built with page builders like Elementor, Beaver Builder, or WPBakery.

Benefits

  • Works with custom product templates
  • Easy integration with page builders
  • Flexible button placement anywhere on the page
  • Improves customer experience by offering samples directly

How to Add Product Sample Button Using Shortcode

Follow these steps to display the sample button on a custom product page:

  1. Go to your product page template (Elementor, Beaver Builder, etc.)
  2. Add a Shortcode widget/block to the desired location
  3. Enter the following shortcode:
[dsfps_sample_button]
  1. Update or publish the page
Admin: Add shortcode in the page builder shortcode block
Front: Product page displaying the “Order a sample” button

Example Use Cases

  • Add a sample button below the product description
  • Show the sample option near the Add to Cart button
  • Place the sample button in a custom product layout
  • Offer samples only on specific product templates

Conclusion

Using the shortcode method gives you full control over where the sample button appears. This is ideal for stores using custom layouts or page builders.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.