1

I am using VirtoCommerce 2.9 and have some questions regarding the API and what would be the best way to get all the information I need, while keeping the number of API requests down.

Right now I am using the endpoint /api/catalog/search to find items that matches a number of attributes. But the response does not include prices and product texts. Both I would like to present to the end user. What would be the correct or best way to retrieve this information?

Thanks!

Cheers!

moccasine
  • 23
  • 5

1 Answers1

0

Currently search service does not return the description and price for the products. To get this details you need to use separate queries

api/catalog/product/ids?respGroup='ItemSmall'

to get product detail with description and

api/pricing/evaluate

to retrieve actual products prices. You can call them in parallel for better performance.

Be aware to use WithProperties response group because it may cause perfomance problem. Anyway product returned with all properties values and this 'response group' is only responsible for retrieving properties meta-information (as possible dictionary values, multilingual, required or optional flag etc) this information often used in admin area and in storefront almost not used.

Indexed search module will be serious changed in future versions, and you will be able to have more control over the product details in the search index.

tatarincev
  • 364
  • 3
  • 5
  • Thanks! That solved my problem. Though I would have preferred an option to receive all this information in one response from the API as this would the client implementation much more straight forward. Can I add it on a wish list for future versions? =) – moccasine May 10 '16 at 10:11
  • Our eCommerce platform constructed with different modules each of its expose self API. Pricing and catalog functionality implemented in different modules that why its difficult to return product with all stuff by one query but its can be doing by many other way 1. Via search index (index product with all prices and return directly from index) 2. Make other module which exposed API returned all products information needs for you solution by one API request – tatarincev May 16 '16 at 16:03