diff --git a/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php b/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php new file mode 100644 index 000000000000..bc308097d3ce --- /dev/null +++ b/vendor/magento/module-customer-segment/Plugin/Framework/App/ActionInterfacePlugin.php @@ -0,0 +1,68 @@ +customerSession->getCustomerId()) { + $customerSegmentIds = $this->customerSegment->getCustomerSegmentIdsForWebsite( + $this->customerSession->getCustomerId(), + $this->storeManager->getWebsite()->getId() + ); + $this->httpContext->setValue(Data::CONTEXT_SEGMENT, $customerSegmentIds, []); + } else { + $this->httpContext->setValue(Data::CONTEXT_SEGMENT, [], []); + } + } +} diff --git a/vendor/magento/module-customer-segment/etc/frontend/di.xml b/vendor/magento/module-customer-segment/etc/frontend/di.xml index 5b4794e6a1ec..8ae129288314 100644 --- a/vendor/magento/module-customer-segment/etc/frontend/di.xml +++ b/vendor/magento/module-customer-segment/etc/frontend/di.xml @@ -1,8 +1,21 @@ @@ -14,6 +27,10 @@ + + +