SHARE
TWEET

Dominykas

a guest Sep 22nd, 2017 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Update variable product regular price. Product ID: 34
  2. $data = [
  3.     'update' => [
  4.         [
  5.             'id' => 34,
  6.             'regular_price' => '555'
  7.         ]
  8.     ]    
  9. ];
  10. print_r($woocommerce->post('products/batch', $data));
  11.  
  12. // Update product variation. Product ID: 34 , product variation ID: 13
  13. $data = [
  14.     'update' => [
  15.         [
  16.             'id' => 13,
  17.             'regular_price' => '777'
  18.         ]
  19.     ]    
  20. ];
  21.  
  22. print_r($woocommerce->post('products/34/variations/batch', $data));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top