How get_price()
-
Hello i want show coupon subtotal price, i’m getting crazy but I found a way
if( $cart_item[‘data’]->get_type() == woosb){
$post_id= $cart_item[‘data’]->get_id();
$product = wc_get_product( $post_id );
$newsubtotal = wc_price( $product->get_sale_price() * ( 1 – ( ‘0.’ . $coupon->get_amount() ) ) * $cart_item[‘quantity’] );
}there’s a faster way?
cause in the not woobs product :
$newsubtotal = wc_price( $cart_item[‘data’]->get_price() * ( 1 – ( ‘0.’ . $coupon->get_amount() ) ) * $cart_item[‘quantity’] );
}
work very well, thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How get_price()’ is closed to new replies.