Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // the code below goes in your functions.php file
- my_custom_prepare_shop_order_object($response, $order, $request) {
- $data = $response->get_data();
- $data['regular_price'] = get_post_meta( $data['id'], '_wholesale_price', true );
- $response->set_data($data);
- return $response;
- }
- add_filter( 'woocommerce_rest_prepare_product_object', array( $this, 'my_custom_prepare_product_object' ), 20, 3 );
- 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