Jump to content

Recommended Posts

Hello Everyone... I am back and with a new problem!

 

Basically i have created a shopping cart in PHP but before that there is a page for the item and a selction of variables e.g. sizes and colours all with different prices,

How would i go about having a total underneith that automatically calculates the total of the options the user selects?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/52018-adding-fields-with-php/
Share on other sites

You are going to have to store the options they select somewhere, either through a form with variables, or in a session. You will also need to somehow link the price for each possible option, which you would probably store in the database.

 

Wait...I just read your question again and may have read it wrong the first time. Are you wanting to have the price update as the user selects options? You will need to look into JavaScript for that.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.