Reputation: 3337
I'm trying to add a product to my cart, like this:
cartFacade.addToCart("M300044", 2);
And it fails with: Product with code 'M300044' not found!
When I debug the code, I find that this query is executed by FlexibleSearchService.search(query):
SELECT {c:pk} FROM {Product AS c} WHERE {c:code}='M300044'
If I execute this query on my hybris Admin console, I do get a Product as a result.
Why can't FlexibleSearchService find it though? Is it something to do with setting a catalog version somewhere?
Upvotes: 1
Views: 6289
Reputation: 1
initialize Junit tenant so by checking import sample data yes so that data which you have in production will be available for testing.
Upvotes: 0
Reputation: 145
I believe this is a SYNCHRONIZATION issue. STAGED Product Version is not aligned with Online. You have two options. HMC > System > Facet Search > indexer wizard. Product Cockpit.
Upvotes: 1
Reputation: 11
You need to make sure one more thing that you have set the session user = admin , because if there is a restriction applied on u r product then your test case won't work
Upvotes: 1
Reputation: 3337
In this case it was because I was doing this from a Test class, so hybris couldn´t find the product because there was no data whatsoever in the junit tenant.
So I had to create the data in the setup method of my Test class, which is executed before the actual test method is called.
Upvotes: 3
Reputation: 522
you need to make full SOLR indexing for the products from hmc before they can appear in front end store or using hypris APIs hope that help
Upvotes: -1