Jump to content

Adding fields with PHP


ow-design

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.