Displaying an empty Mini Basket

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Displaying an empty Mini Basket

Post by Brewhaus » Tue Dec 15, 2015 10:38 am

We are changing up our layout and have the Mini Basket in the right sidebar, but when it is empty it does not display at all. It would be best to have the mini basket display, but simply show "Empty". Can anyone help with this?
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

nadeem
Captain (CAPT)
Captain (CAPT)
Posts: 258
Joined: Tue Jul 31, 2012 7:23 pm

Re: Displaying an empty Mini Basket

Post by nadeem » Tue Dec 15, 2015 10:47 pm

You can do the following updates to make this happen:

Open Website/ConLib/MiniBasket.ascx.cs

Locate the following code inside BindBasket method

Code: Select all

ShowBasket(true);
}
else
{
  ShowBasket(false);
}
and replace with

Code: Select all

ShowBasket(true);
BasketTable.Visible = true;
EmptyBasketPanel.Visible = false;
}
else
{
  ShowBasket(true);
  BasketTable.Visible = false;
  EmptyBasketPanel.Visible = true;
}
This should work as expected now.
Last edited by nadeem on Thu Dec 17, 2015 1:22 am, edited 3 times in total.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Displaying an empty Mini Basket

Post by Brewhaus » Wed Dec 16, 2015 5:57 am

This does get the mini basket to show up and display "Empty", however, it also displays the alternate control. Is there a way to display the mini basket and 'Empty' without the alternate control?
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

nadeem
Captain (CAPT)
Captain (CAPT)
Posts: 258
Joined: Tue Jul 31, 2012 7:23 pm

Re: Displaying an empty Mini Basket

Post by nadeem » Wed Dec 16, 2015 6:56 am

I have updated the above code. Please try this updated code.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Displaying an empty Mini Basket

Post by Brewhaus » Wed Dec 16, 2015 7:28 am

That resolved the issue of displaying the alternate control, but I found that both the revised code and new code have a different issue- the mini basket does not update until you refresh the page. Under the default code, when you add an item to the cart it immediately shows up in the mini basket. With the altered piece of code the mini basket does not update until you refresh the page.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

nadeem
Captain (CAPT)
Captain (CAPT)
Posts: 258
Joined: Tue Jul 31, 2012 7:23 pm

Re: Displaying an empty Mini Basket

Post by nadeem » Thu Dec 17, 2015 1:24 am

Sorry.... I didn't test this, that's why it created trouble for you. Revert all the previous changes and use the new updated/tested code.

Brewhaus
Vice Admiral (VADM)
Vice Admiral (VADM)
Posts: 878
Joined: Sat Jan 19, 2008 4:30 pm

Re: Displaying an empty Mini Basket

Post by Brewhaus » Thu Dec 17, 2015 6:47 am

That did the trick- thank you! :-)
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot

Post Reply