Based on a reference, I was able to populate the field of the regular price based on ACF field alue using the following Code :
add_action( 'woocommerce_process_product_meta',update_product_price_from_acf', 100, 1 );
function update_product_price_from_acf( $product_id ) {
if( $price_acf = get_field( 'netsalesprice', $product_id ) )
update_post_meta( $product_id, '_regular_price', $price_acf );
}
This, however, needs me to go into each product and click update for it to load into the regular price field and is not an automatic fix.
How to make this auto populate without having to click Update on Each Product?
Related Posts:
- AJAX handler throws 400 (Bad request) – why?
- ajax live search for post title
- Display a function using AJAX
- Unable to get_the_content(); of a post in WordPress via AJAX
- Ajaxing function in widget class
- woocommerce target button with class after ajax update
- WP Ajax Function Always Returning undefined
- Scripts not appending to element in AJAX call – why?
- How to search using ajax for exact phrase or words in an input field?
- echo custom fields with AJAX
- Are innerHTML elements visible to jQuery functions?
- get content from page through AJAX
- Get URLs for AJAX Filter Checkboxes WordPress
- wp_set_object_term via js btn frontend
- Ajax Form Issues using Lightsail (AWS)
- post value to function with Ajax and jQuery
- How to use `foreach()` in ajax call
- Multiple Notifications SetInterval
- WordPress Ajaxifying not working properly
- Load scripts into an AJAX div
- Load scripts into an AJAX div
- Automatic add space if user enters number(any digit)
- Ajax call does not work for this custom code
- AJAX values converted to PHP Variables?
- iOS and ajaxComplete
- How to know which ajax file or function is called for action
- Custom Attachment Caption Fields
- how to en-queue jQuery to load before the tag
- Jquery implementation not working on page reload
- Multisite Ajax serialize return error [object Object]
- Default Custom Field Value Automatically Update
- I can’t enqueue my scripts – They literally aren’t being added to my site
- Attempt to change jQuery version caused White Screen of Death
- Create post using Ajax
- How to populate custom field dropdown box based on prior selection?
- PHP mixed with some JS code to update WordPress theme settings
- How to disable controls in theme customizer?
- Load jquery only for certain pages in the backend
- WordPress function saves a post twice and updates all posts
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- WordPress listen to $_POST in functions.php
- Add a jQuery Function
- jQuery does not work
- ACF not showing
- using jQuery on only one page
- Load Post into DIV with Ajax
- wordpress use single ajax in place of multiple ajax requests in a smarter way
- Can’t call Javascript function – scope?
- How to retrieve the values of a sub-field in the first and last row of an (ACF) repeater inside function?
- AJAX error handling for submit function in functions file
- How to get correct value from checked()?
- Changing parent element’s class or style
- Prevent custom field from being updated after first publish
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Custom Behavior when Adding New Custom Post Type in Dashboard
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- Function won’t run onclick using Ajax
- In jquery use php variable to execute an enqueued jquery file
- Run a jquery script on on a certain template page
- Add php code to wp_print_scripts?
- How can i unload effect.min.js file?
- PHP 7.1 | Warning: A non-numeric value encountered in
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Programmatically add Yoast meta description after post save
- Loading two different AJAX requests on two different pages
- WordPress notification if new post published
- Why i can’t get custom fields value or post ID via Ajax?
- Check if a value exists in database table
- Where is this JQuery coming from?
- processing form data with ajax
- Insert Address fields into function
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- How to load jQuery in TOP of wp_footer?
- How to make custom comment fields required
- Passing Jquery value to WordPress function
- Email Exists ERROR into Ajax registration form
- How add body_class from wp_termmeta
- WordPress can’t get jquery/unslider to work
- Add loggedout class on body using a function or JS
- How to use get_posts() function in functions.php
- Include Jquery libraries in wordpress theme?
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- Add a counter for mouseovers (custom field)
- Sort and display pages with specific custom field (not tag)
- Ajax resetting my global variable
- shorthand syntax for custom fields
- Fill empty custom field with other custom field
- contact form in template with jquery,validate and ajax
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Execute Jquery when a specific page in my plugin is loading
- Creating multiple category drop down
- Perform function on publish AND save (not just save)
- How to setup a popup registeration page in wordpress with function.php
- colorbox not loading in
- Trying to implement AJAX into my admin pages. Am I improperly enqueue and localizing my scripts?
- How to add php within jquery
- Help with IF has focus then… statment