Automattic\WooCommerce\Internal\CostOfGoodsSold
CostOfGoodsSoldController::product_meta_lookup_table_cogs_value_columns_exist
Tells if the COGS value column exists in the product meta lookup table.
Method of the class: CostOfGoodsSoldController{}
No Hooks.
Returns
true|false. True if the column exists, false otherwise.
Usage
$CostOfGoodsSoldController = new CostOfGoodsSoldController(); $CostOfGoodsSoldController->product_meta_lookup_table_cogs_value_columns_exist(): bool;
CostOfGoodsSoldController::product_meta_lookup_table_cogs_value_columns_exist() CostOfGoodsSoldController::product meta lookup table cogs value columns exist code WC 10.5.0
public function product_meta_lookup_table_cogs_value_columns_exist(): bool {
global $wpdb;
return (bool) $wpdb->get_var(
$wpdb->prepare(
"SHOW COLUMNS FROM {$wpdb->prefix}wc_product_meta_lookup LIKE %s",
'cogs_total_value'
)
);
}