HELP! Checkout Button Empties Basket

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

HELP! Checkout Button Empties Basket

Post by ZLA » Mon Jun 15, 2009 2:46 pm

On my dev machine, I can no longer checkout. After adding an item to the cart, if I View Cart and click on Checkout, it redirects to the same page with a message that "Your Cart is Empty". I've stepped through the code and ac_BasketItems gets cleared when BasketHelper.SaveBasket(BasketGrid) is called, specifically when that method calls item.Save. It was working yesterday but not today.

I'm still looking into what changes I made in code or in the underlying data but I thought someone might be able to tell me the obvious things to check.

Thanks.

afm
Captain (CAPT)
Captain (CAPT)
Posts: 339
Joined: Thu Nov 03, 2005 11:52 pm
Location: Portland, OR
Contact:

Re: HELP! Checkout Button Empties Basket

Post by afm » Mon Jun 15, 2009 3:00 pm

Database full and out of disk space can cause that behavior.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: HELP! Checkout Button Empties Basket

Post by ZLA » Mon Jun 15, 2009 3:08 pm

I found my error. We don't want customers to select quantity. All our items are personalized and the quantity will always be 1. But making the updowncontrol always non visible screws up its value in Basket.ascx.

Here's the customized code:

Code: Select all

                            <asp:PlaceHolder ID="ProductQuantityPanel" runat="server" Visible='False'>
                                <cb:updowncontrol MinValue="0"  id="Quantity" runat="server" MaxValue="32767" DownImageUrl="~/images/down.gif" UpImageUrl="~/images/up.gif" Columns="2" MaxLength="5" Text='<%# Eval("Quantity") %>' onFocus="this.select()"></cb:updowncontrol>
                            </asp:PlaceHolder>
                            <asp:PlaceHolder ID="OtherQuantityPanel" runat="server" Visible='True' EnableViewState="false">
                                <%#Eval("Quantity")%>
                            </asp:PlaceHolder>
I suspect this is a deficiency of the underlying GridView. Guess I'll have to make it visible but css display:none.

Thank you anyway for the suggestion.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: HELP! Checkout Button Empties Basket

Post by AbleMods » Tue Jun 16, 2009 8:34 am

It doesn't screw it up, it just doesn't get set. The default value of '1' is established in the updown control.

Establishing the quantity value in the code should resolve the issue.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

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

Re: HELP! Checkout Button Empties Basket

Post by mazhar » Tue Jun 16, 2009 8:43 am


ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: HELP! Checkout Button Empties Basket

Post by ZLA » Tue Jun 16, 2009 8:52 am

I went with CSS. Very simple to implement and the least impact. Here's what I changed the markup to:

Code: Select all

<ItemTemplate>
    <asp:PlaceHolder ID="ProductQuantityPanel" runat="server" 
            Visible='<%#((OrderItemType)Eval("OrderItemType") == OrderItemType.Product)%>'>
        <cb:updowncontrol CssClass="HiddenPanel" MinValue="0"  id="Quantity" runat="server" MaxValue="32767"
            DownImageUrl="~/images/down.gif" UpImageUrl="~/images/up.gif" Columns="2" MaxLength="5" 
           Text='<%# Eval("Quantity") %>' onFocus="this.select()"></cb:updowncontrol>
    </asp:PlaceHolder>
    <asp:PlaceHolder ID="OtherQuantityPanel" runat="server" Visible='True' EnableViewState="false">
        <%#Eval("Quantity")%>
    </asp:PlaceHolder>							
</ItemTemplate>
I just added CssClass="HiddenPanel" to the updowncontrol and made OtherQuantityPanel always visible.

Post Reply