Add to Cart on CategoryDetailsPage

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Add to Cart on CategoryDetailsPage

Post by jsmits » Fri Oct 23, 2009 10:48 am

I am trying to add an AddToCartLink to the CategoryDetailsPage by doing something like this:

Code: Select all

<asp:PlaceHolder ID="phCategoryContents" runat="server">            
            <!-- Top Bar -->
            <div class="catalogWrapper" style="padding:0px;">
                <asp:Repeater ID="CatalogNodeList" runat="server" OnItemDataBound="CatalogNodeList_ItemDataBound" EnableViewState="false">
                    <HeaderTemplate>
                        <table width="100%">
                    </HeaderTemplate>
                    <ItemTemplate>                       
                        <asp:PlaceHolder ID="phItemTemplate1" runat="server"></asp:PlaceHolder>  
                        <uc:AddToCartLink ID="Add2Cart" runat="server" ProductId='<%#Eval("ProductId")%>' />
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                    <SeparatorTemplate>
                        <tr><td colspan="2"><hr /></td></tr>
                    </SeparatorTemplate>
                </asp:Repeater>                
            </div>            
        </asp:PlaceHolder>
But the catalogNode object doesn't have the property ProductId, so the above won't work. Is there a better way to do this?

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Add to Cart on CategoryDetailsPage

Post by jmestep » Fri Oct 23, 2009 1:12 pm

You can try the CatalogNodeId instead of ProductId. If that doesn't work, then you would need to load the product for that CatalogNodeId.
Product product = new Product();
product = ProductDataSource.Load(CatalogNodeId);
(Off the top of my head)
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: Add to Cart on CategoryDetailsPage

Post by jsmits » Mon Oct 26, 2009 10:06 am

Thanks Judy, CatalogNodeId worked like a charm.

Post Reply