The rate of change of stuff in the Sitecore is exciting for working in the ecosystem. But a challenge is that things sometimes move faster than the clear documentation. A project I'm involved with bumped into an issue here recently, which seemed worth writing down to (hopefully) help others.
url copied!
If you're making use of OrderCloud for commerce work, there's a pretty strong chance you're also using Search in order to help customers find products. And for efficiency, its pretty likely that when you show a page of product search results, all the data on screen is coming from the search index. That's pretty certain to be faster than having to do lookups to OrderCloud (or your CMS) each time you're displaying a product.
So Sitecore have a pre-built integration between OrderCloud and Search. It consists of two things:
And there's some brief documentation of this in the Search docs.
Following that (and with some discussion with Support) it's fairly easy to get product records into an index.
url copied!
But OrderCloud doesn't keep prices in those base product records. It has a more complex model, where Price Schedules are separate, so you can pick which one is applied based on the customer looking at the site. Hence you probably need your search data to include this, so you can show the right prices to individual users. And the search integration supports this.
But having followed the instructions as published, prices were not appearing in the index and hence not available in results.
url copied!
A bit of time with support brought out a key bit of missing knowledge. The documentation referenced above talks about picking the "Product" entity for your indexing. But it doesn't say anything about what this needs to contain. And currently it seems that the default entity provided can miss out some stuff that the search integration needs for pricing. Plus if you made use of a custom entity for your index, you might not have known what to add anyway. These doesn't necessarily cause the indexing to fail, but it does mean you don't get all the data you may need.
So if you're not seeing prices in your data (or if you have other issues with the responses), check if your chosen entity has the following attributes on top of the default stuff:
| Display name | Field name | Type |
|---|---|---|
| OC Buyer Groups | buyergroups | Array of strings |
| OC Buyers | buyers | Array of strings |
| OC Catalogs | catalogs | Array of strings |
| OC Categories | categories | Array of objects |
| OC Marketplace | marketplace | String |
| OC OwnerID | ownerid | String |
| OC Party Discounts | partydiscounts | Array of objects |
| OC Party Price Schedules | partypriceschedules | Array of objects |
| OC Seller Default Price Schedules | sellerdefaultpriceschedules | Array of objects |
| OC Suppliers | suppliers | Array of strings |
| OC User Groups | usergroups | Array of strings |
| OC Active | active | boolean |
All of these need to be set as "returned in response".
Given we've discussed this with support, hopefully the current base entity definitions and the documentation will get updated to make all this clearer. But until then, hopefully this may help a few people...
↑ Back to top