VirtoCommerce API 获取商品价格

VirtoCommerce API getting item prices

我正在使用 VirtoCommerce 2.9,对 API 有一些疑问,什么是获取我需要的所有信息的最佳方式,同时减少 API 请求的数量。

现在我正在使用端点 /api/catalog/search 来查找与多个属性相匹配的项目。但响应不包括价格和产品文本。两者我都想呈现给最终用户。检索此信息的正确或最佳方法是什么?

谢谢!

干杯!

目前搜索服务没有return产品的描述和价格。 要获取此详细信息,您需要使用单独的查询

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

获取带有描述的产品详细信息和

api/pricing/evaluate

检索实际产品价格。您可以并行调用它们以获得更好的性能。

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.

索引搜索模块将在未来的版本中发生重大变化,您将能够更好地控制搜索索引中的产品详细信息。