Problem:
In a multisite environment, You are using /atg/commerce/catalog/ProductLookup droplet to lookup a product using its ID, but it returns empty although you are sure that such a product exists in your repository.
Debugging:
ProductLookup droplet is an ItemLookupDroplet, which looks up repository items. In a multisite environment, it will return the product only if it belongs to the site in context, or one of the site ids passed as optional input parameters.
1) To check if this is the problem, add the ‘wrongSite’ oparam to the ProductLookup droplet.
<dsp:oparam name="wrongSite">
Wrong site
</dsp:oparam>
Or you may enable logDebug on the ProductLookup droplet, and the same information will be there in the logs.
2) If it turned out that it is returning wrong site, then, check in BCC to see if the catalog is associated properly to the site. Look under:-
Merchandizing > Site Catalogs > Your catalog > sites
3) Now if even that is proper, then it is quite possible that the CatalogMaintenanceService (CMS) did not run properly after you deployed the changes to the catalog. The CMS is responsible for making the association between products / skus and sites. To verify this, you can go to the database to the catalog schema, and see the contents of this table – dcs_product_sites. This table is expected to have an association between the product and the site.
4) Now if you see that this association is missing, try running CatalogMaintenanceService manually. You can do this from:-
dyn/admin > Commerce Administration > Catalog Maintenance > Basic Maintenance
Once this finishes successfully, try the ProductLookup again.
5) Now, why did the CatalogMaintenanceService run in the first place?
For this to run automatically after each BCC deployment, you need to have the module DCS.PublishingAgent running in one of your commerce server instances. Include this module in your build.
Recent Comments