Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2002
    Location
    hells, kitchen
    Posts
    6

    need help with php script one year free hosting offered

    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.

  2. #2
    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:
    Code:
    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.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •