Page 1 of 1

Hide View Cart Button

Posted: Thu Sep 09, 2010 2:58 pm
by joea84
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>

Re: Hide View Cart Button

Posted: Sat Sep 11, 2010 9:23 pm
by triplw
Use different scriptlets for the different pages is the easiest way to handle this.

Re: Hide View Cart Button

Posted: Wed Sep 15, 2010 9:38 am
by plugables
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.

Re: Hide View Cart Button

Posted: Tue Oct 19, 2010 4:25 pm
by skhvatkov2010
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!