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
- Ajax call always returns 0
- How to display custom field in woocommerce orders in admin panel?
- Get a list of all available fields in the User Profile
- wp_get_attachment_image returns different image size
- Enabling shortcodes for custom fields
- Add options to featured image
- Using email_exists() wp function in an ajax request
- Update WordPress Custom Field with AJAX on cached page
- Most efficient way to get custom database records from 20 buttons and 20 tables?
- Assign category using custom field?
- Function to Download External Images to My Site
- Click loads template via ajax
- How to use max and min values of custom fields
- jQuery Plugin to use WordPress functions in AJAX request
- jquery won’t load in footer
- ‘is’ functions and ‘get_query_var’ not working
- Replace menu links with # and add name to its li
- Ajax not working properly
- Wp_query function to search from product_title ‘OR’ product tags name
- Allow Post Author to be 0 on Update
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Search filter by Post title OR Meta Title Value [duplicate]
- dynamic dependent select dropdown
- How to change the order of Jquery in the footer of my theme?
- admin-ajax.php + load-scripts.php hanging for minutes
- Attempt to change jQuery version caused White Screen of Death
- How to disable controls in theme customizer?
- 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
- Add a jQuery Function
- jQuery does not work
- How to get correct value from checked()?
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Function won’t run onclick using Ajax
- PHP 7.1 | Warning: A non-numeric value encountered in
- Loading two different AJAX requests on two different pages
- WordPress notification if new post published
- Check if a value exists in database table
- Where is this JQuery coming from?
- Insert Address fields into function
- How add body_class from wp_termmeta
- Add loggedout class on body using a function or JS
- How to use get_posts() function in functions.php
- How do I display a date correctly that is stored in the database as a backwards 8 digit number from Advanced Custom Fields? [closed]
- shorthand syntax for custom fields
- How to add php within jquery
- Help with IF has focus then… statment
- Ajax filter with loadmore button
- Hide ‘add to cart’ when certain value in dropdown is selected
- Update $wpdb query with AJAX
- Finding post ID dynamically on click
- Images with overlay
- How Can I Concatenate A String With One Of My Custom Field Value Before Saving The Post?
- Create New User Custom Field not Saving
- i can’t use wordpress functions in ajax loaded php file
- Hide empty custom field
- How to echo the translated custom field?
- same get_posts function works diffrently in tag.php and functions.php
- How to add function to custom fields when page/post has a password?
- How to exclude posts with empty and non-existent relational custom field with meta_query?
- WordPress Jquery+scripts enqueue issue
- Moving CDN jQuery to footer does not work?
- Adding a jQuery rotator function
- functions.php filters not applied in AJAX call
- Define an extra field for all pages (with no plugin?)
- Pass max posts to Javascript
- Why are some custom javascript files working but some are not
- How to use different jquery function of idangero swiper dependant on page template?
- Syling Custom Fields echo’s from from functions.php
- admin-ajax.php nulls all php variables
- How do I get my nav menu to show sub pages?
- Having problems loading Jquery in functions.php
- Why wp_ajax hooks doesn’t work?