Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Last active October 20, 2015 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/cb49e3dfd04b67450d2c to your computer and use it in GitHub Desktop.
Save digitalchild/cb49e3dfd04b67450d2c to your computer and use it in GitHub Desktop.
WC Vendors Pro - Force simple product and downloadable / virtual
<?php
// Adjust the following in your product-edit.php template
// Remove this from lines 50 to 55 in product-edit.php
// <div class="all-100">
// <!-- Product Type -->
// <div class="wcv-product-type">
// <?php WCVendors_Pro_Product_Form::product_type( $object_id ); ?>
// </div>
// </div>
//
//
// Add the following in its place, remember to keep the php tags
?>
<!-- Product Type -->
<?php
//Product Type
WCVendors_Pro_Form_Helper::input( array(
'post_id' => $object_id,
'type' => 'hidden',
'id' => 'product-type',
'value' => 'simple',
'show_label' => false
)
);
// Virtual Product
WCVendors_Pro_Form_Helper::input( array(
'post_id' => $object_id,
'type' => 'hidden',
'id' => '_virtual',
'value' => 'yes',
'show_label' => false
)
);
// Downloadable Product
WCVendors_Pro_Form_Helper::input( array(
'post_id' => $object_id,
'type' => 'hidden',
'id' => '_downloadable',
'value' => 'yes',
'show_label' => false
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment