SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2007
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating A Shopping Cart

    I'm building a custom eCommerce store(shopping cart), I'm using ajax(jquery)
    to post the Add to Cart button when clicked so the page doesn't have to
    be refreshed, after submitting, the cart is updated and a message is generated by the server-side
    script which I display in a div on the page using

    $("#message-div").html(data);

    Now, how do I make this message appear in a pop up
    modal dialog instead of that div.

    2. how do I display the new updated cart
    info on the same page (without refreshing).

    Thanks.

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    For displaying the message in the popup you can use "fancybox". And for showing the updated information in the cart, you can send a ajax request after every cart operation (add/edit/delete) for calculation of price and total item in cart etc. and update the response in the div were you are showing the current cart information.
    PHP Programming Its more than just writing code

  3. #3
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,900
    Mentioned
    212 Post(s)
    Tagged
    12 Thread(s)
    FancyBox might be a little overkill for the modal dialogue.
    You could also consider using the lightweight leanModal.js
    See this thread for details: http://www.sitepoint.com/forums/show...html-page-open


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •