How change I make this list of products?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

How change I make this list of products?

Post by Mike718NY » Mon Aug 04, 2008 11:04 am

My client wants a full list of all products by a few select Manufacturers
listed in alphabetical order, . . like shown in the attached graphic.

Using AC7, how do I do this? thanks
alist.jpg

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: How change I make this list of products?

Post by sohaib » Mon Aug 04, 2008 12:34 pm

You need to write a custom control for this.

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: How change I make this list of products?

Post by Mike718NY » Tue Aug 05, 2008 8:12 am

How do I get access to the product "Name" field, where it
equals a specific Manufacturer?
I don't know how to access the data layer in AC7.
Do I need to create my own connection and sql query or can
I access this field some other way?

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: How change I make this list of products?

Post by heinscott » Tue Aug 05, 2008 12:13 pm

Not sure if this will help at all, but, I renamed my webpage.aspx, took out all the existing code, and basically started with an empty project that includes the store header. That way, you have access to the Able Commerce data structures. Check it out. Just to show you how easy the data structures are to work with, I've included an example that loops through all the manufacturers, and prints out the products that are associated with them. I have the output going directly to screen... this is by no means a usable solution, but hopefully it will steer you in the right direction.

Code: Select all

<%@ Page Language="C#" MasterPageFile="~/Layouts/Scriptlet.master" Inherits="CommerceBuilder.Web.UI.AbleCommercePage" Title="View Webpage" %>
<%@ Register Assembly="CommerceBuilder.Web" Namespace="CommerceBuilder.Web.UI.WebControls.WebParts" TagPrefix="cb" %>
<%-- 
<DisplayPage>
    <Name>Basic Webpage</Name>
    <NodeType>Webpage</NodeType>
    <Description>A basic display handler for webpages.  It shows the webpage content with standard headers and footers.</Description>
</DisplayPage>
--%>
<script runat="server">
    Webpage _Webpage = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        ManufacturerCollection allMans = ManufacturerDataSource.LoadForStore();
        foreach (Manufacturer thisMan in allMans)
        {
            Response.Write("<h1>"+thisMan.Name+"</h1><br>");
            ProductCollection productByManList = ProductDataSource.LoadForCriteria("ManufacturerId = "+ thisMan.ManufacturerId);
            foreach (Product p in productByManList)
            {
                Response.Write(p.Name+"<br>");
            }
        } 
    }
</script>
<asp:Content ID="MainContent" ContentPlaceHolderID="PageContent" Runat="Server">
    <cb:ScriptletPart ID="WebpagePage" runat="server" Layout="Left Sidebar" Header="Standard Header" Content="Webpage Page" Sidebar="Standard Sidebar 1" Footer="Standard Footer" Title="View Webpage" AllowClose="False" AllowMinimize="false" />
</asp:Content>
Let me know if you need any further help in understanding what is going on here.

Scott

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: How change I make this list of products?

Post by Mike718NY » Tue Aug 05, 2008 1:41 pm

thanks Scott, that's definately is a big help.

I would need to modify this so it just displays one Manufacturer, and
I would like to add a link to the product name.

How can learn to use the Able Commerce data structures?
Are they easy to use?
Thanks
Mike

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: How change I make this list of products?

Post by heinscott » Tue Aug 05, 2008 2:01 pm

They are very easy to learn! The best way to learn, I've found, is to look through the code of some of the other pages. The ones that have code included on the page itself may be the easiest to understand. Try something in the Admin/Reports directory, maybe. Also, you should go to http://wiki.ablecommerce.com/index.php/ ... uilder_API , and click on the "Compiled Help File" link. This is a file that gives detailed information on all classes and methods available.
Also, continue to use the forums. There is a wealth of information available here, and many extremely helpful people.
Good luck with everything.

Scott

Post Reply