/** * Returns true if the price calculator and calculated weight are enabled for the given product * * @since 3.0 * @param WC_Product $product the product * @return boolean true if the price calculator and stock management are enabled */ public static function pricing_calculated_weight_enabled($product) { if (self::calculator_enabled($product)) { if ('no' !== get_option('woocommerce_enable_weight', true)) { // see whether a calculator is configured for this product $settings = new WC_Price_Calculator_Settings($product); return $settings->is_pricing_calculated_weight_enabled(); } } return false; }