I was wondering if someone can help me. I want to have it like where users have dropdown boxes to choose from each option with a price. When they select that option, it adds to the price. And when they are done selecting all of the the options they want, it will show them the total and they will have a button to pay through paypal. How would I go upon doing this also with that they need to input their address so we know where to ship the controller but also makes them pay at the same time. Here is an image to show an example
You pretty much just need to create a php script that includes variables that assigns values to each of your options.
Example.
[php]
Item 1 $35 Item 1 $45 Item 1 $55 [/php]Create the php page like this:
[php]<?php
$item1 = _$POST[‘a’];
$item2 = _$POST[‘b’];
$item3 = _$POST[‘c’];
$totalcost= $item1 + $item2 + $item3;
[/php]
ou get the point im trying to give right?
You pretty much just need to create a php script that includes variables that assigns values to each of your options.
Example.
[php]
Item 1 $35 Item 1 $45 Item 1 $55 [/php]Create the php page like this:
[php]<?php
$item1 = $_POST[‘a’];
$item2 = $_POST[‘b’];
$item3 = $_POST[‘c’];
$totalcost= $item1 + $item2 + $item3;
[/php]
ou get the point im trying to give right?
Ineedhelp is correct. First, you would need a database with all of your products in place including your prices.
Also, one further trick that would help you is to use database “id” fields for all items. You can use the id field
for a product in your code. When you create the drop-down “select/option” clause in your code, it would
fill in the data from the database with the “id” value as the value of the option and the product name as the
text. Then, when the user pressed the add-to-cart button, it would post out to another page that would
read the values of the options the user selected and then calculate the total price and add it to the cart.
There are many tutorials on how to do this in posts on this site and all over the internet in google search.
I suggest search our site using “cart” or “paypal cart” and see what you find.
Also, when you get further in your code, post here for help. We can help! But, please use a Subject line that
indicates your problem. This entire site is “Help with PHP”. If it is a cart question, members with cart knowledge
can zone in on your post quicker. So, hope this helps along with Ineedhelp’s info. Ask any further questions
you may have. We are here to help you! Good luck.