Issue Displaying Multiple Product Query Web Parts on the Same Page
-
Monday, July 19, 2010 7:49 AM
Hi All,
I need to display multiple lists of products on the same page.
I added one Product Query Web Part on the page and it displays data correctly; but, once I added another Product Query Web Part on the same page, both web parts are show nothing.
Both web parts are linked to the same catalog and category, and they should display the same list of products. But, there is nothing displayed, in any of them.
Is it a limitation in regards to how many Product Query Web Parts are to be displayed on a page?
What I need eventually is to display multiple product lists on the same page, pointing to different categories. Has somebody done this before?
Thanks,
Odilia
Answers
-
Monday, July 19, 2010 9:36 AM
Hi,
If you have a look at the CommerceSharePointExtensibilityKit, you will find a method called IsWebPartValid(). This method check if you have more than one webpart (with the function ThereIsOnlyOneProductProvider).
So, if you want more than one instance, just comment the below code:
// Make sure there is only one instance of a product provider
if (this.ThereIsOnlyOneProductProvider() == false)
{
isValid = false;
this._errorMessage = Microsoft.Commerce.Portal.Common.SiteContext.GetLocalizedString(Microsoft.Commerce.Portal.Common.ResourceName.CatalogResources, "MoreThanOneProductProvider") + "<br>";
}
follow me on twitter @GaelDuhamel or check out my blogs http://www.gaelduhamel.fr http://www.gaelduhamel.com- Proposed As Answer by Gael DuhamelMVP Monday, July 19, 2010 11:59 AM
- Marked As Answer by Emre Daglik Tuesday, July 20, 2010 2:31 PM
All Replies
-
Monday, July 19, 2010 9:36 AM
Hi,
If you have a look at the CommerceSharePointExtensibilityKit, you will find a method called IsWebPartValid(). This method check if you have more than one webpart (with the function ThereIsOnlyOneProductProvider).
So, if you want more than one instance, just comment the below code:
// Make sure there is only one instance of a product provider
if (this.ThereIsOnlyOneProductProvider() == false)
{
isValid = false;
this._errorMessage = Microsoft.Commerce.Portal.Common.SiteContext.GetLocalizedString(Microsoft.Commerce.Portal.Common.ResourceName.CatalogResources, "MoreThanOneProductProvider") + "<br>";
}
follow me on twitter @GaelDuhamel or check out my blogs http://www.gaelduhamel.fr http://www.gaelduhamel.com- Proposed As Answer by Gael DuhamelMVP Monday, July 19, 2010 11:59 AM
- Marked As Answer by Emre Daglik Tuesday, July 20, 2010 2:31 PM
-
Monday, July 19, 2010 11:29 AMThanks Gael, it worked!
-
Monday, July 19, 2010 11:59 AMKewl :)
follow me on twitter @GaelDuhamel or check out my blogs http://www.gaelduhamel.fr http://www.gaelduhamel.com

