diff --git a/src/jobs/UpdateProductVariants.php b/src/jobs/UpdateProductVariants.php index 8f1d969..75cd125 100644 --- a/src/jobs/UpdateProductVariants.php +++ b/src/jobs/UpdateProductVariants.php @@ -24,7 +24,9 @@ public function execute($queue): void $api = Plugin::getInstance()->getApi(); /** @var Product|null $product */ - if ($product = Product::find()->shopifyId($this->shopifyProductId)->one()) { + $product = Product::find()->shopifyId($this->shopifyProductId)->one(); + + if ($product) { $variants = $api->getVariantsByProductId($this->shopifyProductId); $product->setVariants($variants); /** @var ProductDataRecord $productData */