Support

Account

Home Forums General Issues ACF refresh button

Solving

ACF refresh button

  • HHi,

    I’ve added a custom save button to a custom field in the order page.

    I run a simple ajax call once the user click on it to save the informations added in the field.

    The url looks like this

    IE /wp-admin/admin-ajax.php?action=some_action&var={acf[field_5691f90569c3a]}

    Is there a way I can modify this to force the page to update when i click on it.

  • Whats on the page are you trying to update. Are you able to do a simple window.location.reload(); ajax return? This makes me cringe knowing what is coming with Gutenberg.

  • Hi,

    I am trying to update a custom field ( in the woocommerce order page). Once the field is saved, I then change the status email to complete and send the number into the order completion email. using this code:

    // define the woocommerce_email_before_order_table callback 
    function action_woocommerce_email_before_order_table( $order, $sent_to_admin, $plain_text, $email ) { 
        
        
        if (get_field('ACFFIELDNAME', $order->get_id())) { // Only show if field is filled
     
    ?>
            <h3>Your number: <?php the_field('ACFFIELDNAME', $order->get_id()); ?></h3>
                  
            <?php 
            
        }
    
    }; 
             
    
    // add the action 
    add_action('woocommerce_email_before_order_table', 'action_woocommerce_email_before_order_table', 10, 4 );
    
    
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘ACF refresh button’ is closed to new replies.