Using AC 7.0.7 and trying to make an adjustment to the RelatedProducts conlib so it only displays 4 items max. I added the "MaxItems" flag but it continues to display all of the related items. I tried this on a 100% clean and unmodified version and it does the same. Is there a fix for this?
Here is my code:
[[ConLib:RelatedProducts Caption="Related Items" MaxItems="4" Orientation="HORIZONTAL" Columns="4"]]
All of the option flags are working as expected except for MaxItems.
Related products in 7.0.7
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: Related products in 7.0.7
It looks like a valid bug.
If you open the file RelatedProducts.ascx.cs around line 89 you find this:
A quick fix might be to add a check against the MaxItems property:
This should limit the display to the first X items. However a better fix would probably choose a random selection from the available set.
If you open the file RelatedProducts.ascx.cs around line 89 you find this:
Code: Select all
if (relatedProduct.ChildProduct.Visibility == CatalogVisibility.Public)
Code: Select all
if (relatedProduct.ChildProduct.Visibility == CatalogVisibility.Public && products.Count < this.MaxItems)
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: Related products in 7.0.7
I assumed the MaxItems flag would display a random set of results. Is there a way I can do this that is similar to the fix above?Logan Rhodehamel wrote:It looks like a valid bug.
If you open the file RelatedProducts.ascx.cs around line 89 you find this:
A quick fix might be to add a check against the MaxItems property:Code: Select all
if (relatedProduct.ChildProduct.Visibility == CatalogVisibility.Public)
This should limit the display to the first X items. However a better fix would probably choose a random selection from the available set.Code: Select all
if (relatedProduct.ChildProduct.Visibility == CatalogVisibility.Public && products.Count < this.MaxItems)
Re: Related products in 7.0.7
Randomizing the results is a different issue. It would actually be considered an enhancement. I made the suggestion that we add a new property to enable or disable randomization because we shouldn't change the existing behavior of a control. If considered, it would have to be something we add to our current version of AbleCommerce Gold.
Thank you for choosing AbleCommerce!
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support
http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support