I have found a bug if multiple stores are used.
The Froogle generates for each store a file. The input to the file is the store in GenerateFeed(...store)..
However, for the category the next function is called. This function has caching on the current store context. This makes that a wrong category is given back.
Call in GenerateFeed:
//product type [product_type] - Your category of the item
var defaultProductCategory = _categoryService.GetProductCategoriesByProductId(product.Id).FirstOrDefault();
if (defaultProductCategory != null)
{
var category = defaultProductCategory.Category.GetFormattedBreadCrumb(_categoryService, separator: ">");
if (!String.IsNullOrEmpty((category)))
{
writer.WriteStartElement("g", "product_type", googleBaseNamespace);
writer.WriteCData(category);
writer.WriteFullEndElement(); // g:product_type
}
}
Function call of
GetProductCategoriesByProductId
/// <summary>
/// Gets a product category mapping collection
/// </summary>
/// <param name="productId"> Product identifier</param>
/// <param name="showHidden"> A value indicating whether to show hidden records</param>
/// <returns> Product category mapping collection</returns>
public virtual IList<ProductCategory> GetProductCategoriesByProductId(int productId, bool showHidden = false)
{
if (productId == 0)
return new List<ProductCategory>();
string key = string.Format(PRODUCTCATEGORIES_ALLBYPRODUCTID_KEY, showHidden, productId, _workContext.CurrentCustomer.Id, _storeContext.CurrentStore.Id);
return _cacheManager.Get(key, () =>
{
correct implementation should cache for storeid and check limitations per store as well.