Hide View Cart Button

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
joea84
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 27
Joined: Wed May 26, 2010 11:55 am

Hide View Cart Button

Post by joea84 » Thu Sep 09, 2010 2:58 pm

Hi,

I am on this page of my website:

~/basket.aspx

Here is the file:

~\App_Data\Scriptlets\Custom\Layout\Account.htm

On the top right, there is a button called View Cart. If I am on the basket page, I want to hide this button. If I am on the home page, I want this button visible. How can I test and see if I'm on the basket page?

Code: Select all

<td align="right">
                      <!--  <a href="~/Default.aspx" class="button" style="display:none;">Start Quote</a> -->                       
                        <a href="~/Basket.aspx" class="button">View Cart</a>
				        #if($customer.IsAnonymous)
					        <a href="~/Login.aspx" class="button">Login</a>
				        #else
				            <a href="~/Members/MyAccount.aspx" class="button">Account</a>
					        <a href="~/Logout.aspx" class="button">Logout</a>
				        #end    
				        #if($customer.IsAdmin)
					        <a href="~/Admin/Default.aspx" class="button">Admin</a>
				        #end				                            
                    </td>

User avatar
triplw
Commander (CMDR)
Commander (CMDR)
Posts: 144
Joined: Sat Jan 12, 2008 5:34 pm
Contact:

Re: Hide View Cart Button

Post by triplw » Sat Sep 11, 2010 9:23 pm

Use different scriptlets for the different pages is the easiest way to handle this.

plugables
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Sat Aug 15, 2009 4:04 am
Contact:

Re: Hide View Cart Button

Post by plugables » Wed Sep 15, 2010 9:38 am

Just create a new scriptlet 'Basket Page Header' that contains everything from your standard header except the view cart link. Then on basket page set it to use this new scriptlet for header.

skhvatkov2010
Ensign (ENS)
Ensign (ENS)
Posts: 8
Joined: Mon Oct 11, 2010 4:12 pm

Re: Hide View Cart Button

Post by skhvatkov2010 » Tue Oct 19, 2010 4:25 pm

Locate this line of code

Code: Select all

<a href="~/Basket.aspx" class="button">View Cart</a>
and replace it with

Code: Select all

#if ($page.Request.Path.ToLower().IndexOf("basket.aspx") < 0)
<a href="~/Basket.aspx" class="button">View Cart</a>
#end
Good luck!

Post Reply