Hello all,
- I’m in the midst of creating a small ecommerce, and given that I’ve only started studying PHP a few days ago and thus only understand the very basics, I’m having quite a bit of trouble with the PHP scripting to process the order form (more specifically, with the pricing). The three variables that affect the total price are the following:
Delivery time: Under 24 hours = most expensive , 24-48 hours = little less expensive, 48-72 hours = little less expensive, 72-120 hours = little less expensive, 120-168 hours = little less expensive, over 168 hours (7 days) = least expensive
Product quality (sort of): For the purpose of this inquiry, think of it as “fair” (least expensive), “good”, “great”, “excellent” (most expensive).
Therefore, price per unit depends on the delivery time (on the y axis) and ‘product quality’ (on the x axis). So in the order form, if someone for instance selects 48-72 hours + great quality, the appropriate price should be calculated.
And finally, total price should be the price per unit multiplied by the number of units ordered.
How can this be done in PHP?
-
In light of this, I’m also having trouble implementing the proper way to select the delivery date in the order form? Maybe 4 scroll down menus, including the day, month, year and approx hour of delivery? Any help here would be hugely appreciated as well.
-
Based on the variables selected, I’d also like the total price to be updated on the order page in real time. I assume a client-side script like javascript would be necessary here?
-
How do you make certain fields mandatory?
-
After the order form has been properly completed, I’d like the client to be taken to the payment page (credit card or paypal).
That about sums it up. Thanks in advance for any scripts you can provide, or at least for pointing me in the right direction.