Skip to content

Commit f5a88e4

Browse files
authored
Merge pull request #1649 from algolia/fix/MAGE-1145-lp-customer-groups-3.14
MAGE-1145: Fix Landing Page creation when customer groups are enabled (3.14.4)
2 parents e162a63 + 5e86d68 commit f5a88e4

File tree

1 file changed

+9
-7
lines changed
  • Controller/Adminhtml/Landingpage

1 file changed

+9
-7
lines changed

Controller/Adminhtml/Landingpage/Save.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ public function execute()
107107
$data['configuration'] = $data['algolia_configuration'];
108108
if ($this->configHelper->isCustomerGroupsEnabled($data['store_id'])) {
109109
$configuration = json_decode($data['algolia_configuration'], true);
110-
$priceConfig = $configuration['price'.$data['price_key']];
111-
$customerGroups = $this->customerGroupCollectionFactory->create();
112-
$store = $this->storeManager->getStore($data['store_id']);
113-
$baseCurrencyCode = $store->getBaseCurrencyCode();
114-
foreach ($customerGroups as $group) {
115-
$groupId = (int) $group->getData('customer_group_id');
116-
$configuration['price.'.$baseCurrencyCode.'.group_'.$groupId] = $priceConfig;
110+
if (isset($configuration['price'.$data['price_key']])) {
111+
$priceConfig = $configuration['price'.$data['price_key']];
112+
$customerGroups = $this->customerGroupCollectionFactory->create();
113+
$store = $this->storeManager->getStore($data['store_id']);
114+
$baseCurrencyCode = $store->getBaseCurrencyCode();
115+
foreach ($customerGroups as $group) {
116+
$groupId = (int) $group->getData('customer_group_id');
117+
$configuration['price.'.$baseCurrencyCode.'.group_'.$groupId] = $priceConfig;
118+
}
117119
}
118120
$data['configuration'] = json_encode($configuration);
119121
}

0 commit comments

Comments
 (0)