Dynamic Pricing not being posted to Order in Woocomerce

I am using WooCommerce 3.0, I have set the product price on a certain page.

       $regular_price = get_post_meta( $_product->id, '_regular_price', true);
      $buyback_percentage = get_post_meta( $_product->id, '_goldpricelive_buy_back', true);
      $fixed_amount = get_post_meta( $_product->id, '_goldpricelive_fixed_amount', true);
      $markedup_price = get_post_meta( $_product->id, '_goldpricelive_markup', true);
      $buyback_price = ($regular_price - $fixed_amount)/(1 + $markedup_price/100)  * (1-$buyback_percentage/100);
      $_product->set_price($buyback_price);

the price is updating on my cart but when i click on to submit my order, Order object doesnt seem to get the price i set, it takes the origin product price. Any idea on how i can accomplish this.

Read more here: Dynamic Pricing not being posted to Order in Woocomerce

Leave a Reply

Your email address will not be published. Required fields are marked *