回帖总数:
112
业力:
590
注册日期:
2010/1/1
位置:
Pakistan
Hi, I like to use 2 images for the cart i.e. empty and full By default the empty shopping cart image is shown but when any item is added then the cart icon should changed to the one that shows the cart filled. Any idea how to do that?
回帖总数:
187
业力:
2299
注册日期:
2009/11/25
位置:
United Kingdom
do a count on the number of items in the basket. based on this logic, you can choose which image to display.
回帖总数:
112
业力:
590
注册日期:
2010/1/1
位置:
Pakistan
can u explain with a little more guidance please, I am new to codes and dont have much knowledge
回帖总数:
585
业力:
3231
注册日期:
2009/6/14
位置:
New Zealand
You need to alter this in Header.ascx <li><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>" class="ico-cart"> <%=GetLocaleResourceString("Account.ShoppingCart")%> </a><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>">(<%=ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart).Count%>)</a> </li> The image has to do with ico-cart so you just need to check whether the count is greater than 0 and change the class accordingly. Hope this helps. Thanks, Matthew
回帖总数:
112
业力:
590
注册日期:
2010/1/1
位置:
Pakistan
Thanks Matthew Can you tell me how to check the count and change class accordingly? Sorry I am dumb with codes :(
回帖总数:
585
业力:
3231
注册日期:
2009/6/14
位置:
New Zealand
For a really really dirsty hack in header.ascx you could replaceUNTESTED <li><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>" class="ico-cart"> <%=GetLocaleResourceString("Account.ShoppingCart")%> </a><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>">(<%=ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart).Count%>)</a> </li> with <%if (ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart).Count > 0) { %> <li><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>" class="ico-cart-fill"> <%=GetLocaleResourceString("Account.ShoppingCart")%> </a><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>">(<%=ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart).Count%>)</a> </li> <%} else { %> <li><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>" class="ico-cart"> <%=GetLocaleResourceString("Account.ShoppingCart")%> </a><a href="<%=Page.ResolveUrl("~/ShoppingCart.aspx")%>">(<%=ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart).Count%>)</a> </li> <%} %> then create a new class in master.css like .header .ico-cart-fill { background: url('images/ico-cart-fill.gif') no-repeat; padding-left: 20px; padding-bottom: 5px; }
回帖总数:
112
业力:
590
注册日期:
2010/1/1
位置:
Pakistan
Thanks Matthew, you are a great ... it worked