Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created November 9, 2021 06:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save digitalchild/184f9db890d695d8fcdfb02a351023fd to your computer and use it in GitHub Desktop.
Save digitalchild/184f9db890d695d8fcdfb02a351023fd to your computer and use it in GitHub Desktop.
Add inventory fields to product-simple.php template for WC Vendors Pro
add_action( 'wcv_after_product_simple_after', 'wcv_add_inventory_fields' );
function wcv_add_inventory_fields( $object_id ){
?>
<!-- Inventory -->
<div class="wcv-product-inventory inventory_product_data tabs-content" id="inventory">
<?php WCVendors_Pro_Product_Form::manage_stock( $object_id ); ?>
<?php do_action( 'wcv_product_options_stock', $object_id ); ?>
<div class="stock_fields show_if_simple show_if_variable">
<?php WCVendors_Pro_Product_Form::stock_qty( $object_id ); ?>
<?php WCVendors_Pro_Product_Form::backorders( $object_id ); ?>
<?php WCVendors_Pro_Product_Form::low_stock_threshold( $object_id ); ?>
</div>
<?php WCVendors_Pro_Product_Form::stock_status( $object_id ); ?>
<div class="options_group show_if_simple show_if_variable">
<?php WCVendors_Pro_Product_Form::sold_individually( $object_id ); ?>
</div>
<?php do_action( 'wcv_product_options_sold_individually', $object_id ); ?>
<?php do_action( 'wcv_product_options_inventory_product_data', $object_id ); ?>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment