Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: Display Product Price on the Wishlist

  1. #1
    chamberinternet is offline Member
    Join Date
    Jul 2009
    Posts
    30

    Default Display Product Price on the Wishlist

    Hello,

    Is there a way in which the price of the product can be displayed within the wishlist page?

    Thanks a lot

    Shafiq
    Using AspDotNetStorefront ML 8.0.1.2

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    There are two things you can do here. One requires source but is a bit easier, the second does not require source but is a bit more work.

    The first way to accomplish this is by modifying the ShoppingCart class. You'll need to modify the DisplayItems method
    Code:
    public String DisplayItems(bool VarReadOnly, Customer ViewingCustomer, bool ShowItemDeleteButton)
    Find the comment // TOTAL/ACTION COL...this is where the price column starts for the shoppingcart but only shows the move to cart button for wishlists. You would have to copy the logic that calculates price for the shoppingcart page into the if statement that executes if a wishlist and write it out to the page
    Code:
    if (CartType == CartTypeEnum.WishCart)
    {
        // the pricing logic would go here and you could write it out to the page however you see fit
        // ...
        // ...
        if (AppLogic.ProductHasVisibleBuyButton(c.m_ProductID))
        {
            tmpS.Append("<input type=\"button\" class=\"MoveToCartButton\" value=\"" + String.Format(AppLogic.GetString("shoppingcart.cs.5", m_SkinID, m_ThisCustomer.LocaleSetting), AppLogic.GetString("AppConfig.CartPrompt", m_SkinID, m_ThisCustomer.LocaleSetting)) + "\" onClick=\"self.location='wishlist.aspx?movetocartid=" + c.m_ShoppingCartRecordID.ToString() + "';\">");
        }
        else
        {
            tmpS.Append("&nbsp;");
        }
    }
    The second alternative, the one that doesn't require source but will take a bit of work, is to create an appconfig parameter called XmlPackage.WishListPageItems and give it the value of a custom xmlpackage that you wrote (eg. you could create an xmlpackage called wishlist.cartitems.xml.config and give the XmlPackage.WishListPageItems appconfig parameter a value of wishlist.cartitems.xml.config). The page will then use this xmlpackage to display the wishlist items instead of the ShoppingCart.DisplayItems method, but you'll have to write this xmlpackage from scratch, including the query to return the information you want to display on the page.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    chamberinternet is offline Member
    Join Date
    Jul 2009
    Posts
    30

    Default

    That's Great.

    Thanks for your help George....
    Using AspDotNetStorefront ML 8.0.1.2

  4. #4
    gleapman is offline Member
    Join Date
    Apr 2009
    Location
    Golden, CO
    Posts
    45

    Default

    I realize this thread ended awhile ago, but just for future reference...

    There MAY be a simpler way to do this. I've been doing some modifications on the WishList page unrelated to the item prices and found that if you change the CartType from WishList to ShoppingCart just before calling cart.DisplayItems in InitializePageContent(), it brings back the price (actually, the subtotal, I think). I was concerned that it would also return shopping cart items instead of wish list items, but that does not appear to be the case. (I haven't figured out how it knows to bring back the Wish List items.) It might also make sense to change the CartType back after calling DisplayItems.

    I haven't done any testing, so this may not work or there could be some unintended side effects. But it may be worth a shot.