Skip to content

Commit

Permalink
Addressed PR comment re check of the Woo Plugin version before callin…
Browse files Browse the repository at this point in the history
…g a function.
  • Loading branch information
Marian Shymon committed Nov 28, 2024
1 parent b4df259 commit 531ebd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/fbproduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

require_once __DIR__ . '/fbutils.php';

use WooCommerce\Facebook\Framework\Plugin\Compatibility;
use WooCommerce\Facebook\Framework\Helper;
use WooCommerce\Facebook\Products;

Expand Down Expand Up @@ -721,7 +722,7 @@ public function prepare_product( $retailer_id = null, $type_to_prepare_for = sel
}

// Add GTIN (Global Trade Item Number)
if ( $gtin = $this->woo_product->get_global_unique_id() ) {
if ( Compatibility::is_wc_version_gte( '9.1.0' ) && $gtin = $this->woo_product->get_global_unique_id() ) {
$product_data['gtin'] = $gtin;
}

Expand Down

0 comments on commit 531ebd7

Please sign in to comment.