Products by manufactuer Map

This forum is where we'll mirror posts that are of value to the community so they may be more easily found.
Post Reply
User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Products by manufactuer Map

Post by mazhar » Mon Dec 22, 2008 5:49 am

The attachment contains two controls the ManufacturersList control which renders all available manufacturers as hyperlinks to the product display page. The second control is ProductsByManufacturer control responsabile for listing products for a specific manufacturer. In order to install these controls extract the attachment and place these two files in your website's ConLib folder. Now Place ManufacturersList control on some of your store pages where you want your customer to select a brand. Now place the ProductsByManufacturer control on some store page where you want to list the products by manufacturer. The final job is to edit the ManufacturersList file and adjust the hyperlink to meet your needs for example locate the following line of code

Code: Select all

<a href='ProductsByManufacturPage.aspx?ManufacturerId=<%#Eval("ManufacturerId") %>'>
and change ProductsByManufacturPage.aspx part to the name of page on which you placed your ProductsByManufacturer control. For example if the page name is abc.aspx then the above code should be something like

Code: Select all

<a href='abc.aspx?ManufacturerId=<%#Eval("ManufacturerId") %>'>
ProductsByManufacturer, ManufacturersList Screen Shots

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Mon Dec 22, 2008 12:09 pm

Christmas has come a few days early! :) Thank you so much for this post. Mahzar, where would you like your gifts to be sent?
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Mon Dec 22, 2008 11:20 pm

I have spent some time working with this and I cannot get the page to load. Has anyone else had the same experience?
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Tue Dec 23, 2008 2:31 am

I have spent some time working with this and I cannot get the page to load. Has anyone else had the same experience?
Explain the problem in detail?

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Tue Dec 23, 2008 10:26 am

Let me re-trace my steps as I can not put my finger on the problem other than the page will not load and the path errors out.

-Uploaded both files to the site ConLib folder
-Created a page called ShopbyBrand.aspx and put [[Conlib:ManufacturersList]] on that page
-Changed the line in the Conlib to read - <a href='ShopbyBrand.aspx?ManufacturerId=<%#Eval("ManufacturerId") %>'>

From there..... http://www.schoolsupplystore.com/ShopbyBrand.aspx rendors a '?aspxerrorpath='
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Tue Dec 23, 2008 10:49 am

Try

Code: Select all

<a href='~/ShopbyBrand.aspx?ManufacturerId=<%#Eval("ManufacturerId") %>'>

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Tue Dec 23, 2008 11:19 am

Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Mon Jan 12, 2009 11:26 am

These updated files contains the listing page and scriptlet as well. Just install the files to your application in the same order in which they are packaged.

divers-supply
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Fri Nov 21, 2008 5:15 pm

Re: Products by manufactuer Map

Post by divers-supply » Wed Mar 25, 2009 11:15 am

Hello,
We installed the code and it works great until you click on a heading to sort the data then it gives the below error.

http://www.divers-supply.com/ProductsBy ... turerId=50
For Instance if you go to the above page and then click on "SKU" or "Name" or any heading then you get an error. See below.




Server Error in '/' Application.
--------------------------------------------------------------------------------

The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NotSupportedException: The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.]
System.Web.UI.WebControls.ObjectDataSourceView.CreateEnumerableData(Object dataObject, DataSourceSelectArguments arguments) +1267391
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2891
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +24
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

Any help would be appreciated.
Thank you
Debbie

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by Manufacturer Map

Post by mazhar » Mon Mar 30, 2009 6:08 am

divers-supply wrote:Hello,
We installed the code and it works great until you click on a heading to sort the data then it gives the below error.

http://www.divers-supply.com/ProductsBy ... turerId=50
For Instance if you go to the above page and then click on "SKU" or "Name" or any heading then you get an error. See below.




Server Error in '/' Application.
--------------------------------------------------------------------------------

The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NotSupportedException: The data source 'ProductDS' does not support sorting with IEnumerable data. Automatic sorting is only supported with DataView, DataTable, and DataSet.]
System.Web.UI.WebControls.ObjectDataSourceView.CreateEnumerableData(Object dataObject, DataSourceSelectArguments arguments) +1267391
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2891
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +24
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

Any help would be appreciated.
Thank you
Debbie
That is due to a small missing piece of information. Please edit the ProductsByManufacturer.ascx control file and locate following code

Code: Select all

<asp:ObjectDataSource ID="ProductDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="AdvancedSearch" TypeName="CommerceBuilder.Products.ProductDataSource">
and make it look like

Code: Select all

<asp:ObjectDataSource ID="ProductDS" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="AdvancedSearch" TypeName="CommerceBuilder.Products.ProductDataSource" SortParameterName="sortExpression">

divers-supply
Ensign (ENS)
Ensign (ENS)
Posts: 20
Joined: Fri Nov 21, 2008 5:15 pm

Re: Products by manufactuer Map

Post by divers-supply » Mon Mar 30, 2009 9:13 pm

Thanks Mazhar
That worked perfect! :lol:

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Products by manufactuer Map

Post by mfreeze » Tue Jun 23, 2009 2:45 pm

This is a great control; I had a similar function in 5.5 which my customers wanted to retain and this works great as a replacement.

Some of my customers have requested the display of a product image be added.

I looked up the asp:gridcontrol and found there is a way to do this using <asp:ImageField DataImageUrlField="PictureURL"></asp:ImageField> but I haven't been able to figure out how to incorporate the product thumbnail or icon into this.

Is there a way to pull the product's thumbnail and add it to the display?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Wed Jun 24, 2009 5:20 am

mfreeze wrote:This is a great control; I had a similar function in 5.5 which my customers wanted to retain and this works great as a replacement.

Some of my customers have requested the display of a product image be added.

I looked up the asp:gridcontrol and found there is a way to do this using <asp:ImageField DataImageUrlField="PictureURL"></asp:ImageField> but I haven't been able to figure out how to incorporate the product thumbnail or icon into this.

Is there a way to pull the product's thumbnail and add it to the display?
Edit the ascx file and then add following code to columns list

Code: Select all

<asp:TemplateField>
                <ItemTemplate>
                    <asp:Image ID="ProductImage" runat="server" ImageUrl='<% #Eval("ThumbnailUrl")%>' />
                </ItemTemplate>
            </asp:TemplateField>
for example just locate following entry

Code: Select all

<asp:BoundField DataField="Sku" HeaderText="SKU" SortExpression="Sku">                
                <HeaderStyle HorizontalAlign="Left" />
            </asp:BoundField>  
and change it as below

Code: Select all

<asp:TemplateField>
                <ItemTemplate>
                    <asp:Image ID="ProductImage" runat="server" ImageUrl='<% #Eval("ThumbnailUrl")%>' />
                </ItemTemplate>
            </asp:TemplateField>
<asp:BoundField DataField="Sku" HeaderText="SKU" SortExpression="Sku">                
                <HeaderStyle HorizontalAlign="Left" />
            </asp:BoundField>  

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: Products by manufactuer Map

Post by mfreeze » Wed Jun 24, 2009 9:26 am

Awesome! I implemented it on both the manufacturer and advanced searches and my clients love it!
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Wed Sep 09, 2009 2:05 pm

This feature seems to no longer work for me. Not sure if this is related to an upgrade or something else. Currently using 7.0.2 build 11659 Manufacturer listing appears to be linked but a click takes the user nowhere. It also creates an error in the admin error log. 'The file does not exist' Anyone else having similar issues?
Bryan Bundgaard
AC7 User http://www.SchoolSupplyStore.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Thu Sep 24, 2009 8:17 am

Make sure that in scriptlets you are pointing to correct ConLib file paths.

User avatar
Tomgard
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 108
Joined: Sun Jul 20, 2008 1:00 pm

Re: Products by manufactuer Map

Post by Tomgard » Tue Oct 13, 2009 2:44 pm

The page URL of http://www.schoolsupplystore.com/ShopbyBrand.aspx loads properly.

Clicking on any one of these manufactures then loads the following URL (specific to a manufacturer)
http://www.schoolsupplystore.com/Shopby ... urerId=321
but the page view remains that of the original http://www.schoolsupplystore.com/ShopbyBrand.aspx although the URL has changed.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Wed Oct 14, 2009 4:40 am

seems like your listing page is not pointing to correct product listing page. Locate the page having product listing page for manufacturer and then correct the URL in listing control to point to correct page. Currently its pointing to current page. You can also try by putting the product listing control on current page as well.

kens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Wed Apr 04, 2007 7:57 am
Location: West Palm Beach, FL
Contact:

Re: Products by manufactuer Map

Post by kens » Sat Nov 20, 2010 7:43 pm

This is a great mod, thanks Mazhar.

Is there a way to get the manufacturer name to appear in the page title for productbymanufacturer.aspx?

Thanks

Ken

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Mon Nov 22, 2010 8:48 am

kens wrote:This is a great mod, thanks Mazhar.

Is there a way to get the manufacturer name to appear in the page title for productbymanufacturer.aspx?

Thanks

Ken
In ProductsByManufacturer.ascx file locate following line

Code: Select all

<div class="section">
and then update it as

Code: Select all

<div class="pageHeader">
    <h1 class="heading"><asp:Localize ID="ManufacturerName" runat="server" EnableViewState="false"></asp:Localize></h1>
</div>
<div class="section">
then locate following code block

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
        BindProductsGrid();
    }
and update it as

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
int manufacturerId = CommerceBuilder.Utility.AlwaysConvert.ToInt(Request.QueryString["ManufacturerId"]);
        CommerceBuilder.Products.Manufacturer manufacturer = CommerceBuilder.Products.ManufacturerDataSource.Load(manufacturerId);
        ManufacturerName.Text = manufacturer.Name;
        BindProductsGrid();
    }
This should do the trick

kens
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Wed Apr 04, 2007 7:57 am
Location: West Palm Beach, FL
Contact:

Re: Products by manufactuer Map

Post by kens » Wed Nov 24, 2010 10:07 am

Mazhar-

Thanks so much for the help. This code was helpful, however, w hat I was actually trying to accomplish was to get the manufacturer name in the page tite in the head of the document, instead of the "View Webpage" that comes up now.

Thanks

Ken

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Products by manufactuer Map

Post by mazhar » Mon Nov 29, 2010 5:57 am

I see, in order to do that you need something like this

Code: Select all

protected void Page_Load(object sender, EventArgs e)
    {
int manufacturerId = CommerceBuilder.Utility.AlwaysConvert.ToInt(Request.QueryString["ManufacturerId"]);
        CommerceBuilder.Products.Manufacturer manufacturer = CommerceBuilder.Products.ManufacturerDataSource.Load(manufacturerId);
       Page.Title = manufacturer.Name;
        BindProductsGrid();
    }

briwel
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Thu May 05, 2011 4:47 pm

Re: Products by manufactuer Map

Post by briwel » Thu May 05, 2011 5:17 pm

Hello,

I am evaluating Able and am generally very pleased but have found one area that is going to require customization. I am trying to figure out the best way to go about it and get a clearer sense of how complex it will be and would appreciate any input.

Important to our design is that we present a list of brands (I've already gotten this to work using Mazhar's code from this post) and that each brand link to a page that shows all of the products for that brand and above those products displays either embedded brand marketing video, a slideshow, or a static image depending on what marketing material we have available for that brand. My concern here isn't so much regarding the specifics of how we'll generate the marketing content: if I can create an iframe and pass a brand identifier to a page that I will write independently of Able to render the content I can manage that part.

The standard product grid display is more similar to how we want to display the brand's products than Mazhar's ProductsByManufacturPage.aspx. One approach would be to customize ProductsByManufacturPage to look more like the product grid. But I see that some of Able's product display or search pages, when passed a url parameter m=ManufacturerID, will show only products from that manufacturer. I'm wondering what would be the implications of me linking to Search.aspx, for instance, or a slightly modified copy of it and using that as my so-called "Brand Page". I'm interested in any thoughts on the relative merits of the two approaches.

Something else that I've realized may be an issue is that when the user moves between pages of products, I think it would be undesirable for a YouTube video to load anew on each page. I think that the way Able handles pagination renders the page anew each time the page is changed which would force the video to reload. One thought I've had is that it might be acceptable to only show the video on page 1, which I suppose I could do easily enough in code, but I'm curious if anyone has any other thoughts on a solution to this issue.

And finally, assuming, like I said, that I don't write any of the logic to show the marketing content in Able, but rather in an iframe that's pulling from a CMS or something like that, I do wish that I could pass to the CMS page a brand identifier that is meaningful to it. In our current product database in MS Dynamics, we have a short brand name that would be ideal. The brand display name isn't great to use because it can have url-unfriendly characters in it, and the Brand ID in Able isn't meaningful outside of Able. I suppose that would require adding a field for short brand ID, and I'm not sure how doable this is.

Thanks in advance for any input!

Regards,

Brian

Post Reply