Reply To: Incorrect database table definition in your PHP script

Top WooCommerce & WordPress Plugins Forums Cost of Goods for WooCommerce Incorrect database table definition in your PHP script Reply To: Incorrect database table definition in your PHP script

#101682
michal.vlcek
Participant

Hi, yes we have Cost of Goods for WooCommerce Pro 2.7.3 and WooCommerce 7.0.1 and the problem still persists.
The same error above is still written in the PHP log file.

I already wrote you the fix above and it is directly in the source of your plugin
in file: /cost-of-goods-for-woocommerce-pro/includes/analytics/class-alg-wc-cog-analytics-products.php
on line 72:

$clauses[] = “, SUM(wp_wc_order_product_lookup.product_net_revenue – alg_cog_oimc.meta_value * product_qty) AS profit_total”;

change to:

$clauses[] = “, SUM({$wpdb->prefix}wc_order_product_lookup.product_net_revenue – alg_cog_oimc.meta_value * product_qty) AS profit_total”;

and it will be good.

Best regards
Michal