Developer forum

Forum » Development » Custom related product provider

Custom related product provider

Anders Ebdrup
Reply

Hi!

 

I am getting an error for my custom related product provider:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Dynamicweb.eCommerce.Products.GroupCollection.get_Item(Int32 Index)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProduct(Product Product, Boolean ExtendedProperties, Template Template, Int32 loopCounter, Boolean renderRelated, String productURL)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProducts(ProductCollection Products, Template ParentTemplate, String LoopName, Int32 LoopCounter, Boolean renderRelatedProducts, Boolean renderRelatedLists)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderRelatedProductLists(Template template, RelatedProductListProviderEventArgs relatedParams)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProduct(Product Product, Boolean ExtendedProperties, Template Template, Int32 loopCounter, Boolean renderRelated, String productURL)
   at Dynamicweb.eCommerce.Frontend.Renderer.RenderProduct(Product Product, Boolean ExtendedProperties)
   at Dynamicweb.eCommerce.Frontend.Frontend.RenderProduct(Product prod)
   at Dynamicweb.eCommerce.Frontend.Frontend.EcomRender()
   at Dynamicweb.eCommerce.Frontend.Frontend.GetContent()
   at Dynamicweb.Frontend.Content.getModule(DataRow& ParagraphRow)

Which seems to be caused by the that fact no group is associated with the product. Should this be the standard behaviour? And should I always check if a product is placed in a group?

 

Best regards, Anders


Replies

 
Mikkel Høst
Reply

Hi Anders.

I think it is. I did this once and ended up putting the products in group called "NoGroup" :)

 
Anders Ebdrup
Reply

Hi Mikkel,

 

Thank you for the quick answer - my next question is then; should this be the standard behaviour? :-)

 

Best regards, Anders

 
Mikkel Høst
Reply

Well IMO no, otherwise there should be a constraint so no products could be created without a group :)

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi guys,

 

This should not be standard behavior. It occurs because canonicals in eCommerce has been turned on and since this relies on the Group hierachy, this fails.

 

I've added a bug report (#13049) to our backlog to simply not create a canonical in this instance. It will be out with the next hotfix for 8.3.

 

- Jeppe

 
Anders Ebdrup
Reply

 

Original message by Mikkel Høst posted on 11/09/2013, 15:07:

Well IMO no, otherwise there should be a constraint so no products could be created without a group :)

Indeed, but then there will be a problem with integrated solutions where you not necessary are able to control that.

 

You must be logged in to post in the forum