Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2011
    Location
    Preston, UK
    Posts
    131
    Thanks
    36
    Thanked 0 Times in 0 Posts

    How can I get my Cart to automatically update?

    I am writing a shopping cart and I'm not very good at it.
    I have just about finished it, but the problem that I have is that when the cart is updated, the value showing in the top RH corner of the page does not change with the update.
    In order to update the cart, showing at the top RH corner, I have to reload the page. It then changes to the correct amount.
    I have setup a test account if anybody would like to check what I mean:
    http://http://order.hughes-family-bakers.co.uk/
    Login: user1234
    Passwd: user1234

    In order to recreate the problem, select an item and then click on Add To Cart button at the bottom.
    This takes you to the cart.
    Now change the quantity required and click on the Update Cart button.
    You will see the price change in the cart, but NOT in the top RH corner where the cart is displayed.
    If you now refresh the page the top RH corner cart value will change to the correct amount.
    I'm not sure what information you will require to answer this question so please ask me and I will post it.

    Hope you can understand all this lot.

    Thanks,
    The MAN, The MYTH, The LEGEND:
    John C
    ________________________________
    Support your local Country Music Club

  • #2
    Regular Coder poyzn's Avatar
    Join Date
    Nov 2010
    Posts
    266
    Thanks
    2
    Thanked 61 Times in 61 Posts
    check your script at /shop/cart/cart.php?action=update and fix the part which updates that block

  • Users who have thanked poyzn for this post:

    countrydj (11-24-2012)

  • #3
    Regular Coder
    Join Date
    Nov 2011
    Location
    Preston, UK
    Posts
    131
    Thanks
    36
    Thanked 0 Times in 0 Posts
    Hi poyzn...
    Many thanks for your help.

    I just added
    Code:
    header("Location: cart.php");
    before the break at the end of the code and all is now working.
    I knew that it was something simple, but my mind went blank.
    As a matter of fact it took me 2 minutes to fix it, when you pointed me in the right direction.

    Thanks...
    The MAN, The MYTH, The LEGEND:
    John C
    ________________________________
    Support your local Country Music Club


  •  

    Posting Permissions

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