From 927725b460b60f1919babbe5529da3447bd79386 Mon Sep 17 00:00:00 2001 From: Tam Date: Fri, 23 Aug 2019 16:21:51 +0100 Subject: [PATCH] Fix issue when syncing variants without public urls --- CHANGELOG.md | 4 ++++ composer.json | 2 +- src/services/ProductsService.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cd611d..28c592b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.10 - 2019-08-23 +### Fixed +- Fix issue when syncing variants without public urls + ## 1.1.9 - 2019-08-23 ### Fixed - Fix error when syncing products without public urls (Fixes #9) diff --git a/composer.json b/composer.json index ce20760..bf56e66 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "ether/mailchimp-commerce", "description": "Mailchimp integration with Craft Commerce", - "version": "1.1.9", + "version": "1.1.10", "type": "craft-plugin", "keywords": [ "mailchimp", diff --git a/src/services/ProductsService.php b/src/services/ProductsService.php index d439978..e135b6e 100644 --- a/src/services/ProductsService.php +++ b/src/services/ProductsService.php @@ -318,7 +318,7 @@ private function _buildProductData ($productId) $data['variants'][] = [ 'id' => (string) $variant->id, 'title' => $variant->title, - 'url' => Craft::getAlias($variant->url ?: $product->url), + 'url' => Craft::getAlias(($variant->url ?: $product->url) ?? ''), 'sku' => $variant->sku, 'price' => (float) $variant->price, 'inventory_quantity' => (int) ($unlimited ? PHP_INT_MAX : $stock),