I managed to get it working, here is answer:
– when importing update new stock to custom field: _custom_stock_placeholder
– update only this field: _custom_stock_placeholder
– add this code to functions.php
add_action('pmxi_saved_post', 'post_saved', 10, 1);
function post_saved($id) {
$original_stock = get_post_meta($id, '_stock', true);
$new_stock = get_post_meta($id, '_custom_stock_placeholder', true);
$combined_stock= $original_stock + $new_stock;
update_post_meta($id, '_stock', $combined_stock);
}
Related Posts:
- How to automatically apply woocommerce product title to all product images alt tags?
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- Edit tag cloud widget number
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- The values of custom fields are not available functions.php
- WooCommerce – Display variation custom field value [closed]
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Woocommerce HTML email option unavailable
- How to add SVG icon above product tab title
- WooCommerce: update custom fields after checkout validation failure
- Use is_product_category() properly
- My Own layout in WooCommerce pages [closed]
- Woocommerce – remove product from category
- Changing Woocommerce flat rate every nth number of items
- Limiting woocommerce line_total decimal length
- WooCommerce – Reset quantity input field when variation changes
- get current product name in functions.php
- tracking number field in Woocommerce order [closed]
- Image as Sales Badge
- Automatically remove a canceled order in Woocommerce
- Passing the custom field values in the wp_get_current_user array function
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Firing schema via code in functions.php doesn’t work
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- How can I get the values of my WordPress $wpdb query in Jquery?
- Trouble checking if custom woocommerce checkout field is empty or not
- My new button is in the wrong place
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Which PHP page is the Default Posts Page
- How to check if a PHP string is different than meta field?
- Can’t save php string to a custom field
- How to show/hide php table rows based on the content of custom fields
- require_once() if a product in woocommerce contains a tag [closed]
- Custom meta box values are not getting saved for my custom post type
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Remove item in Checkout
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- Personalize checkout text
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- How do i wrap woocomerce attribute in list?
- Removing files programmatically
- Custom Taxonomy Select Menu: Setting default option value?
- Hide a div when a custom field is empty
- Conditional On custom field plugin metabox
- Execute PHP code only with specific user role
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Woocommerce order status payment
- Dynamically added custom fields not displayed on WooCommerce email notifications
- Modify WooCommerce used to get all orders in dashboard
- Updating Metadata with Shortcode
- Woocommerce My acount page
- Woocommerce – Exclude variation attribute on specific variation
- Products listing check if meta checkbox is checked
- Trying to update Woocommerce meta values
- Is it possible to update the dataset using update_post_meta
- PHP function for horizontal Woocommerce thumbnails and badges
- Hide a div if the fiels is empty
- php code for outputting a custom page in my account
- Hide specific shipping methode depending on day and time of day
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- Adding custom field to product category and show it to shop/category shop page
- Hide payment method based on user role AND minimum cart value
- WooCommerce display price before add to cart [closed]
- Remove span tags from WooCommerce Downloads page
- Including user data in “new user notification email”
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- How do I get the value of a current user’s custom field?
- Add Product Permalink in woocommerce admin order page
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- WP_Query To Display Product Of Brand On Taxonomy Page
- Woocommerce Add custom “Add to cart button” in single page with tags
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- WooCommerce multiple custom fields code
- Display text of price (minus 20%) on every product page in a sentence.
- Woocommerce Price Text
- Display custom meta box in my template file
- How to add margin underneath woocommerce total price amount -> productpages
- ACF Date fileds to Age Convert [closed]
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- Appending an ACF custom field to the page title
- Warning: Attempt to read property “term_id” on int – Woocommerce
- Grabbing value of input field inside of array
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Automatically change insurance quantity based on cart total [closed]
- Change WooCommerce Order status from frontend form submitted data
- How to pass value to add_filter wpcf7_form_tag from another function?
- Custom Admin Menu Report for Specific User ID
- Add text below WooCommerce short description if metabox value is true
- ACF number less than comparison not working