/** * {@inheritdoc} */ public function apply(FilterDatasourceAdapterInterface $ds, $data) { $channelCode = $this->parseData($data); if (!$channelCode) { $channelCode = $this->userContext->getUserChannelCode(); } $this->catalogContext->setScopeCode($channelCode); return true; }
/** * Define locale and scope in CatalogContext */ protected function configureCatalogContext() { $this->catalogContext->setLocaleCode($this->userContext->getCurrentLocaleCode()); $this->catalogContext->setScopeCode($this->userContext->getUserChannelCode()); }