Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Last active October 26, 2016 05:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/cbbb83c972aedebc51f4 to your computer and use it in GitHub Desktop.
Save digitalchild/cbbb83c972aedebc51f4 to your computer and use it in GitHub Desktop.
Custom Product Fields - WC Vendors Pro
<?php
// This will be available in the next version of WC Vendors Pro
// Input type of text on the product-edit.php template
WCVendors_Pro_Form_Helper::input( array(
'post_id' => $object_id,
'id' => '_wcv_custom_product_dispatch_days',
'label' => __( 'Dispatch Days', 'wcvendors-pro' ),
'placeholder' => __( '1 day', 'wcvendors-pro' ),
'desc_tip' => 'true',
'description' => __( 'The number of days to dispatch.', 'wcvendors-pro' ),
'type' => 'text',
)
) );
// To use this in your woocommerce product template page where you want it displayed use the following
$dispatch_days = get_post_meta ($product_id, '_wcv_custom_product_dispatch_days', true );
?>
<p><?php echo $dispatch_days; ?></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment