1

I have several products registered in Backoffice, If I perform a flexible search query directly from HAC I can see any of them, however, If I use ProductService#getProductForCode that performs the same query as I do it doesn't find any products. How is that possible?

Vikrant
  • 1,809
  • 1
  • 13
  • 18
Nexussim Lements
  • 535
  • 1
  • 15
  • 47
  • 1
    are the products synced to the online version of your product catalog? – Yoni Jun 09 '21 at 19:35
  • yes, they are sync – Nexussim Lements Jun 11 '21 at 09:14
  • how are you testing this service? the documentation specifies that only the catalog versions on the session will be used. As you tagged datahub, I assume you have no active catalog on your session when doing the search. Try to debug this with CatalogVersionService#getSessionCatalogVersions right before you fetch the code – Yoni Jun 11 '21 at 16:13

1 Answers1

1

You can try disable search restriction before you call productService#getProductForCode

import de.hybris.platform.search.restriction.SearchRestrictionService;
......
searchRestrictionService.disableSearchRestrictions();
Adiputera
  • 171
  • 1
  • 2
  • 13