Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. // the code below goes in your functions.php file
  4.  
  5. my_custom_prepare_shop_order_object($response, $order, $request) {
  6. $data = $response->get_data();
  7. $data['regular_price'] = get_post_meta( $data['id'], '_wholesale_price', true );
  8. $response->set_data($data);
  9. return $response;
  10. }
  11.  
  12. add_filter( 'woocommerce_rest_prepare_product_object', array( $this, 'my_custom_prepare_product_object' ), 20, 3 );
  13. add_filter( 'woocommerce_rest_prepare_product_variation_object', array( $this, 'my_custom_prepare_product_object' ), 20, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement