• I would like to be able to set the sale_price property for the WC_Product_Simple class, which actually sits in the WC_Product class.

    There appears to be a function for getting the value (get_sale_price), but nothing apparent for actually setting the value. Was this intentional? If so, why?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Mina

    (@purpleberryservices)

    Hi,

    You can use this function.

    update_post_meta( $post_id, ‘_sale_price’, $new_sale_price );

    Thread Starter tjsherlock

    (@tjsherlock)

    Thank you. Yes I have done this already. But your suggestion does not actually set the value of the sale_price property in the WC_Product class. Debug it, and you shall see.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to set sale price’ is closed to new replies.