Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('wcfm_product_fields_stock', function ($fields, $product_id) {
- // For new product only
- if (!$product_id) {
- if (isset($fields['manage_stock'])) $fields['manage_stock']['dfvalue'] = 'enable';
- if (isset($fields['stock_qty'])) $fields['stock_qty']['value'] = '10';
- if ( WCFMu_Dependencies::wcfm_wc_appointments_active_check() ) {
- if ( current_user_can('manage_appointments') ) {
- if (isset($fields['_wc_appointment_qty'])) $fields['_wc_appointment_qty']['value'] = '10';
- }
- }
- }
- return $fields;
- }, 91, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement