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?
- Woocommerce auto cancel On-Hold after X days
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Add custom field to attachments in a specific category
- WooCommerce – Customer Order History Pagination
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- The values of custom fields are not available functions.php
- How can update custom meta for all posts
- 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
- How do I display a user’s previous orders as a select box option on a product?
- How do you add customer capability after Woocommerce purchase?
- 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
- Two Different Links for Same Product – WooCommerce [closed]
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Auto-update products after they were published – Woocommerce
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Display a specific category of products in shop page and disable code for specific actions
- Woocommerce related product text
- 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
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- 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?
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Trouble checking if custom woocommerce checkout field is empty or not
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- My new button is in the wrong place
- Trying to retrieve post meta
- Redirect to another page using contact form 7? [closed]
- 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
- Why does this update_post_meta function not delete the custom field itself?
- 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)
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- Remove item in Checkout
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- woocommerce specific quantities for product
- How to override WooCommerce Order Item Meta with data from Cart?
- Woocommerce textarea format ignored
- 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
- Add missing alt tag to featured images for “storefront” theme
- Display text of price (minus 20%) on every product page in a sentence.
- Use WP_Query Data In Cookie
- Woocommerce Price Text
- Display custom meta box in my template file
- How to get the rating value of each comment
- How to add margin underneath woocommerce total price amount -> productpages
- ACF Date fileds to Age Convert [closed]
- Setting WooCommerce currency programmatically
- 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
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- posts_clauses drop ACF get_field function
- Replace the image of a product with its video in the shop page
- Grabbing value of input field inside of array
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- 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
- Woocomerce custom add to cart button edit functionality [closed]
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- How to capture number input from wordpress form into acf field in woocommerce
- How to get default variation ID (woocommerce)
- Exclude function for custom pages, exclude custom ACF fields
- Assign a value (got from an xml file) to an attribute of Woocommerce products