skip to Main Content

Woocommerce – If variation product then execute condition else if simple then execute other condition

function wooprice(){ global $product; // 1 Get product varations $product_variations = $product->get_available_variations(); // 2 Get one variation id of a product $variation_product_id = $product_variations [0]['variation_id']; // 3 Create the product object $variation_product = new WC_Product_Variation( $variation_product_id ); if ($product->is_type( 'variable'…

VIEW QUESTION
Back To Top
Search