knjhost
06-20-2002, 10:12 PM
I am needing help with a shopping cart that i am building and i need someone who could help show me how to create the ability to declare options for products such as size and color and that each value for size and color could decrease or increase the base cost of a product.
250MB
15 GB transfer
10 Subdomains
100 email accounts
PHP 4.2
MYSQL
PERL
I just need some real help if you interested please contact me through pm or just reply to this message.
GoofBall
06-21-2002, 12:53 AM
Assuming you have a table with products in it, you'll need to add another table that holds the options and corresponding price changes.
For instance:
products options
-------- -------
(id) (option_id)
name product_id
price price_diff
name
If you have a table holding cart contents, you'll need to add a way to reference whichever chosen option there is. If each product only has one possible option, an additional field will suffice. Otherwise, you'll need to create another table that ties option choices to cart contents.
If you'd like more help, feel free to email me using kurt@mackeybros.com and show me your current schema.
chaossociety
06-23-2002, 01:05 AM
without using HTML tags, you could just use
$base_price = "10.99";
say thats the cost of your t shirt or something.....
now, to add lets say 2.50 , for an X-large, do this:
$new_base_price = "$base_price + 2.50";
echo "new price is :$new_base_price";
You can use simple math in PHP, Somthing + something or somthing * something, very easy