Skip to content

Commit 42f23ed

Browse files
committed
Use store ids in the ProductDeleteBefore Observer
1 parent 606ea76 commit 42f23ed

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

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

77
### [Unreleased]
88

9+
### [2.1.1] - 2021-04-21
10+
11+
#### Fixes
12+
- Use store ids instead of website ids in the ProductDeleteBefore Observer
13+
914
### [2.1.0] - 2021-03-22
1015

1116
#### Added
@@ -55,6 +60,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5560
[1.2.4]: https://github.com/klaviyo/magento2-klaviyo/compare/1.2.3...1.2.4
5661
[1.2.3]: https://github.com/klaviyo/magento2-klaviyo/compare/1.2.2...1.2.3
5762

58-
63+
5964
#### NOTE
6065
- 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-

0 commit comments

Comments
 (0)