Batch expiry date shortcode

WooCommerce Batch Numbers comes with a useful shortcode to place the Expiry Date in your product pages, where you have access to the product object. You can also define a time interval from where the date will be showed and hided.

  • show_days_before_expiry=”” accepts a number. Ex: 60
  • hide_days_before_expiry=”” accepts a number. Ex: 30

simple shortcode with default attributes:


shortcode with all atts customized:

[wcpbn_product_next_batch_expiry_date show_days_before_expiry="60" hide_days_before_expiry="30"]

If you’re working directly in template files, you can also use this PHP code:

<?php echo do_shortcode('[wcpbn_product_next_batch_expiry_date]'); ?>