Skip to content

Commit 1619c37

Browse files
committedJun 15, 2020
Fix sync all products' data being null
1 parent e41aa3b commit 1619c37

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.2.2 - 2020-06-15
2+
### Fixed
3+
- Fix sync all products' data being null (via @PieterxJan)
4+
15
## 1.2.1 - 2020-04-15
26
### Added
37
- Add "After build sync data" event to products, allowing for the manipulation of the data that is synced to Mailchimp (Closes #22)

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ Event::on(
6464
\ether\mc\services\ProductsService::EVENT_AFTER_BUILD_SYNC_DATA,
6565
function (\ether\mc\events\BuildSyncDataEvent $event) {
6666
$event->element; // The element being synced
67-
$event->syncdata; // The resulting data to sync
67+
$event->syncData; // The resulting data to sync
6868

6969
// For example, to modify the product description
70-
$event->syncdata->description = $event->element->alternateDescriptionField;
70+
$event->syncData->description = $event->element->alternateDescriptionField;
7171
}
7272
);
7373
```

‎composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ether/mailchimp-commerce",
33
"description": "Mailchimp integration with Craft Commerce",
4-
"version": "1.2.1",
4+
"version": "1.2.2",
55
"type": "craft-plugin",
66
"keywords": [
77
"mailchimp",

‎src/events/BuildSyncDataEvent.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ class BuildSyncDataEvent extends Event
2424
public $element;
2525

2626
/** @var array */
27-
public $syncdata;
27+
public $syncData;
2828

2929
}

‎src/services/ProductsService.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class ProductsService extends Component
4646
* \ether\mc\services\ProductsService::EVENT_AFTER_BUILD_SYNC_DATA,
4747
* function (\ether\mc\events\BuildSyncDataEvent $event) {
4848
* $event->element; // The element being synced
49-
* $event->syncdata; // The resulting data to sync
49+
* $event->syncData; // The resulting data to sync
5050
* }
5151
* );
5252
*/
@@ -348,11 +348,11 @@ private function _buildProductData ($productId)
348348

349349
$event = new BuildSyncDataEvent([
350350
'element' => $product,
351-
'syncdata' => $data,
351+
'syncData' => $data,
352352
]);
353353
$this->trigger(self::EVENT_AFTER_BUILD_SYNC_DATA, $event);
354354

355-
return $event->syncdata;
355+
return $event->syncData;
356356
}
357357

358358
/**

0 commit comments

Comments
 (0)
Please sign in to comment.