What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Attribute-Cart-Based Catalog Personalization when I am trying to hit
Attribute-Cart-Based Catalog Personalization when I am trying to hit http://yves.de.spryker.local/en/cameras-&-camcorders/digital-cameras getting fatal error, Yves exception
Comments
-
@UJN2JRU4F any inputs?
0 -
can you paste the the CatalogDependencyProvider as a snippet here?
0 -
looks like a missing import for the container class
0 -
your ide should tell you that it is unknown, does it not?
0 -
No it is not showing anything
0 -
<?php /** * This file is part of the Spryker Commerce OS. * For full license information, please view the LICENSE file that was distributed with this source code. */ namespace Pyz\Client\Catalog; use Spryker\Client\Catalog\CatalogDependencyProvider as SprykerCatalogDependencyProvider; use Spryker\Client\Catalog\Plugin\ConfigTransferBuilder\AscendingNameSortConfigTransferBuilderPlugin; use Spryker\Client\Catalog\Plugin\ConfigTransferBuilder\CategoryFacetConfigTransferBuilderPlugin; use Spryker\Client\Catalog\Plugin\ConfigTransferBuilder\DescendingNameSortConfigTransferBuilderPlugin; use Spryker\Client\Catalog\Plugin\Elasticsearch\Query\ProductCatalogSearchQueryPlugin; use Spryker\Client\Catalog\Plugin\Elasticsearch\QueryExpander\PaginatedProductConcreteCatalogSearchQueryExpanderPlugin; use Spryker\Client\Catalog\Plugin\Elasticsearch\ResultFormatter\ProductConcreteCatalogSearchResultFormatterPlugin; use Spryker\Client\Catalog\Plugin\Elasticsearch\ResultFormatter\RawCatalogSearchResultFormatterPlugin; use Spryker\Client\CatalogPriceProductConnector\Plugin\ConfigTransferBuilder\AscendingPriceSortConfigTransferBuilderPlugin; use Spryker\Client\CatalogPriceProductConnector\Plugin\ConfigTransferBuilder\DescendingPriceSortConfigTransferBuilderPlugin; use Spryker\Client\CatalogPriceProductConnector\Plugin\ConfigTransferBuilder\PriceFacetConfigTransferBuilderPlugin; use Spryker\Client\CatalogPriceProductConnector\Plugin\CurrencyAwareCatalogSearchResultFormatterPlugin; use Spryker\Client\CatalogPriceProductConnector\Plugin\CurrencyAwareSuggestionByTypeResultFormatter; use Spryker\Client\CatalogPriceProductConnector\Plugin\ProductPriceQueryExpanderPlugin; use Spryker\Client\ProductLabelStorage\Plugin\ProductLabelFacetConfigTransferBuilderPlugin; use Spryker\Client\ProductListSearch\Plugin\Search\ProductListQueryExpanderPlugin; use Spryker\Client\ProductReview\Plugin\RatingFacetConfigTransferBuilderPlugin; use Spryker\Client\ProductReview\Plugin\RatingSortConfigTransferBuilderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\CompletionQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\FacetQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\IsActiveInDateRangeQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\IsActiveQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\LocalizedQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\PaginatedQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\SortedCategoryQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\SortedQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\SpellingSuggestionQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\StoreQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\QueryExpander\SuggestionByTypeQueryExpanderPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\CompletionResultFormatterPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\FacetResultFormatterPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\PaginatedResultFormatterPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\SortedResultFormatterPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\SpellingSuggestionResultFormatterPlugin; use Spryker\Client\SearchElasticsearch\Plugin\ResultFormatter\SuggestionByTypeResultFormatterPlugin; use Pyz\Client\Catalog\Plugin\Elasticsearch\QueryExpander\AttributeCartBasedBoostingQueryExpanderPlugin; class CatalogDependencyProvider extends SprykerCatalogDependencyProvider { const CLIENT_CART = 'CLIENT_CART'; const CLIENT_PRODUCT_STORAGE = 'CLIENT_PRODUCT_STORAGE'; /** * @param \Spryker\Client\Kernel\Container $container * * @return \Spryker\Client\Kernel\Container */ public function provideServiceLayerDependencies(Container $container) { $container = parent::provideServiceLayerDependencies($container); $container = $this->addCartClient($container); $container = $this->addProductStorageClient($container); return $container; } /** * @param \Spryker\Client\Kernel\Container $container * * @return \Spryker\Client\Kernel\Container */ protected function addProductStorageClient(Container $container) { $container[static::CLIENT_PRODUCT_STORAGE] = function (Container $container) { return $container->getLocator()->productStorage()->client(); }; return $container; } /** * @param \Spryker\Client\Kernel\Container $container * * @return \Spryker\Client\Kernel\Container */ protected function addCartClient(Container $container) { $container[static::CLIENT_CART] = function (Container $container) { return $container->getLocator()->cart()->client(); }; return $container; } /** * @return \Spryker\Client\Catalog\Dependency\Plugin\FacetConfigTransferBuilderPluginInterface[] */ protected function getFacetConfigTransferBuilderPlugins() { return [ new CategoryFacetConfigTransferBuilderPlugin(), new PriceFacetConfigTransferBuilderPlugin(), new RatingFacetConfigTransferBuilderPlugin(), new ProductLabelFacetConfigTransferBuilderPlugin(), ]; } /** * @return \Spryker\Client\Catalog\Dependency\Plugin\SortConfigTransferBuilderPluginInterface[] */ protected function getSortConfigTransferBuilderPlugins() { return [ new RatingSortConfigTransferBuilderPlugin(), new AscendingNameSortConfigTransferBuilderPlugin(), new DescendingNameSortConfigTransferBuilderPlugin(), new AscendingPriceSortConfigTransferBuilderPlugin(), new DescendingPriceSortConfigTransferBuilderPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\QueryInterface */ protected function createCatalogSearchQueryPlugin() { return new ProductCatalogSearchQueryPlugin(); } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\QueryExpanderPluginInterface[] */ protected function createCatalogSearchQueryExpanderPlugins() { return [ new StoreQueryExpanderPlugin(), new LocalizedQueryExpanderPlugin(), new ProductPriceQueryExpanderPlugin(), new SortedQueryExpanderPlugin(), // new SortedCategoryQueryExpanderPlugin(CategoryFacetConfigTransferBuilderPlugin::PARAMETER_NAME), new AttributeCartBasedBoostingQueryExpanderPlugin(), new PaginatedQueryExpanderPlugin(), new SpellingSuggestionQueryExpanderPlugin(), new IsActiveQueryExpanderPlugin(), new IsActiveInDateRangeQueryExpanderPlugin(), /** * FacetQueryExpanderPlugin needs to be after other query expanders which filters down the results. */ new FacetQueryExpanderPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\ResultFormatterPluginInterface[] */ protected function createCatalogSearchResultFormatterPlugins() { return [ new FacetResultFormatterPlugin(), new SortedResultFormatterPlugin(), new PaginatedResultFormatterPlugin(), new CurrencyAwareCatalogSearchResultFormatterPlugin( new RawCatalogSearchResultFormatterPlugin() ), new SpellingSuggestionResultFormatterPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\QueryExpanderPluginInterface[] */ protected function createSuggestionQueryExpanderPlugins() { return [ new StoreQueryExpanderPlugin(), new LocalizedQueryExpanderPlugin(), new CompletionQueryExpanderPlugin(), new SuggestionByTypeQueryExpanderPlugin(), new IsActiveQueryExpanderPlugin(), new IsActiveInDateRangeQueryExpanderPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\ResultFormatterPluginInterface[] */ protected function createSuggestionResultFormatterPlugins() { return [ new CompletionResultFormatterPlugin(), new CurrencyAwareSuggestionByTypeResultFormatter( new SuggestionByTypeResultFormatterPlugin() ), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\QueryExpanderPluginInterface[] */ protected function createCatalogSearchCountQueryExpanderPlugins(): array { return [ new StoreQueryExpanderPlugin(), new LocalizedQueryExpanderPlugin(), new IsActiveQueryExpanderPlugin(), new IsActiveInDateRangeQueryExpanderPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\ResultFormatterPluginInterface[] */ protected function getProductConcreteCatalogSearchResultFormatterPlugins(): array { return [ new ProductConcreteCatalogSearchResultFormatterPlugin(), ]; } /** * @return \Spryker\Client\SearchExtension\Dependency\Plugin\QueryExpanderPluginInterface[] */ protected function getProductConcreteCatalogSearchQueryExpanderPlugins(): array { return [ new LocalizedQueryExpanderPlugin(), new PaginatedProductConcreteCatalogSearchQueryExpanderPlugin(), new ProductListQueryExpanderPlugin(), ]; } }
0 -
so there is no use statement for the container
0 -
my ide complains as expected:
0 -
please add the following to the top:
use Spryker\Client\Kernel\Container;
0 -
It worked ๐ Thank you
0 -
๐
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random