Quantcast
Channel: Clan VPS Host » woocommerce
Viewing all articles
Browse latest Browse all 195

How to get current variation data inside raw_woocommerce_price hook?

$
0
0

I'd like to get current variation data inside the raw_woocommerce_price hook. function filter_raw_woocommerce_price( $price_1 ) { global $product; // Some custom code to change price by variation factor $variation_id = product->Something_I_Need_To_Know_To_Get_Current_Variation(); // bla bla bla $factor = PutSomeCustomCalculationHere($variation_id); $price_1 = $price_1 * $factor; return $price_1;}; add_filter( 'raw_woocommerce_price', 'filter_raw_woocommerce_price', 10, 1 ); How can I achieve … Continue reading How to get current variation data inside raw_woocommerce_price hook?

The post How to get current variation data inside raw_woocommerce_price hook? appeared first on Clan VPS Host.


Viewing all articles
Browse latest Browse all 195

Trending Articles