Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Need help with updating a total price

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28147
    tolputt
    Member

    Hi Guys,

    I have used an example reservation code from this site from the freebies sections and modified it slightly so that its to my liking.

    Please see it here…http://tinyurl.com/yh4sgbx

    So i have a select options box to say how many guests will be attending 1 -5.

    And what i need to do is dynamically update a grand total based on that selection.

    So if they pick 1 guest then the total is £25 and so on.

    I have also integrated a paypal button that i bought from Codecanyon which works well but at the minute it only sends a static value to paypal which is defined in the php at the top of the page…

    Code:
    # Product Price in GBP (example 5.00 or 5.99)
    define(‘ProductPrice’,’25.00′);

    So if anyone has any idea as to how i can get the total price to update and then change the value in the php so that it sends the correct cost to paypal i would be very very greatful.

    thanks

    Craig

    #72438
    Democritus
    Member

    Just read the number of guests with javascript, and keep track of the cost. Then when the form submits, shoot that value to your server in a post variable and process it however you want.

    Or, you could have the page submit each time the values changes, so your php could keep track of the number of guests.

    I’d recommend both depending on if the user have javascript enabled or not.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.