Change original price in cart for WooCommerce product variation

Viewed 2504

I tried using this to change the original price in the cart but no dice. I think it's not working because the product I'm using is a variable product. The Product ID is 141 and the variation ID 142.

function sv_change_product_price_cart( $price, $cart_item, $cart_item_key ) {
    if ( 142 === $cart_item['product_id'] ) {
        $price = '$50.00 per Unit<br>(7-8 skewers per Unit)';
    }
    return $price;
}
add_filter( 'woocommerce_cart_item_price', 'sv_change_product_price_cart', 10, 3 );

How to make it work

Thanks

1 Answers
Related