Skip to content

Commit 89af1e3

Browse files
authored
Merge pull request #106 from klaviyo/202104_product-delete-webhook-store-ids
Use store ids in the ProductDeleteBefore Observer
2 parents 606ea76 + ee80f07 commit 89af1e3

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
### [Unreleased]
88

9+
### [2.1.1] - 2021-05-17
10+
11+
#### Fixes
12+
- Use store ids instead of website ids in the ProductDeleteBefore Observer
13+
- Check for versions older than 2.0.0 in UpgradeSchema
14+
915
### [2.1.0] - 2021-03-22
1016

1117
#### Added
@@ -49,12 +55,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4955
- CSP now uses report-only mode
5056

5157

52-
[Unreleased]: https://github.com/klaviyo/magento2-klaviyo/compare/2.1.0...HEAD
58+
[Unreleased]: https://github.com/klaviyo/magento2-klaviyo/compare/2.1.1...HEAD
59+
[2.1.1]: https://github.com/klaviyo/magento2-klaviyo/compare/2.1.0...2.1.1
5360
[2.1.0]: https://github.com/klaviyo/magento2-klaviyo/compare/2.0.0...2.1.0
5461
[2.0.0]: https://github.com/klaviyo/magento2-klaviyo/compare/1.2.4...2.0.0
5562
[1.2.4]: https://github.com/klaviyo/magento2-klaviyo/compare/1.2.3...1.2.4
5663
[1.2.3]: https://github.com/klaviyo/magento2-klaviyo/compare/1.2.2...1.2.3
5764

58-
65+
5966
#### NOTE
6067
- The CHANGELOG was created on 2020-11-20 and does not contain information about earlier releases

Observer/ProductDeleteBefore.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public function __construct(
5454
public function execute(Observer $observer)
5555
{
5656
$product = $observer->getEvent()->getProduct();
57-
$websiteIds = $product->getWebsiteIds();
58-
$storeIdKlaviyoMap = $this->_klaviyoScopeSetting->getStoreIdKlaviyoAccountSetMap($websiteIds);
57+
$storeIds = $product->getStoreIds();
58+
$storeIdKlaviyoMap = $this->_klaviyoScopeSetting->getStoreIdKlaviyoAccountSetMap($storeIds);
5959

6060
foreach ($storeIdKlaviyoMap as $klaviyoId => $storeIds) {
6161
if (empty($storeIds)) {
@@ -72,5 +72,3 @@ public function execute(Observer $observer)
7272
}
7373
}
7474
}
75-
76-

Setup/UpgradeSchema.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UpgradeSchema implements UpgradeSchemaInterface
1919

2020
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
2121
{
22-
if (version_compare($context->getVersion(), '2.0.0', '>')) {
22+
if (version_compare($context->getVersion(), '2.1.1', '<')) {
2323
$installer = $setup;
2424
$installer->startSetup();
2525

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "klaviyo/magento2-extension",
33
"description": "Klaviyo extension for Magento 2. Allows pushing newsletters to Klaviyo's platform and more.",
44
"type": "magento2-module",
5-
"version": "2.1.0",
5+
"version": "2.1.1",
66
"autoload": {
77
"files": [
88
"registration.php"

etc/module.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Klaviyo_Reclaim" setup_version="2.1.0" schema_version="2.1.0">
3+
<module name="Klaviyo_Reclaim" setup_version="2.1.1" schema_version="2.1.1">
44
<sequence>
55
<module name="Magento_Customer"/>
66
<module name="Magento_Checkout"/>

0 commit comments

Comments
 (0)