diff --git a/admin/class-informatiq-sp-admin.php b/admin/class-informatiq-sp-admin.php index 9636a6d9..48af8d62 100644 --- a/admin/class-informatiq-sp-admin.php +++ b/admin/class-informatiq-sp-admin.php @@ -884,10 +884,10 @@ class Informatiq_SP_Admin { $product_id = $product->get_id(); - // Get brand and cost from meta. - $brand = $product->get_meta( '_brand', true ); - $cost = $product->get_meta( '_cost', true ); - $cost = $cost !== '' ? round( (float) $cost, 4 ) : null; + // Get brand and cost from post meta. + $brand = get_post_meta( $product_id, '_brand', true ); + $cost = get_post_meta( $product_id, '_cost', true ); + $cost = ( $cost !== '' && $cost !== false ) ? round( (float) $cost, 2 ) : null; // Get local price (tax-inclusive for comparison with Google). $sale_price = $product->get_sale_price();