lional Posted October 11, 2007 Share Posted October 11, 2007 Hi All I am trying to create an e-commerce site where we have a specials page and if a product is purchases from the specials page there will be a discount, but if the same product is purchased from another page, then the discount does not apply. I am not sure how I would do this, any suggestions will be appreciated. Here is my code so far: $qty1 = 1; // This page adds products to the shopping cart if (is_numeric ($_GET['pid'])) { // check for a print id $pid = $_GET['pid']; $spec = $_SESSION['special']; // check to see if the cart already contains one of these products if (isset ($_session['cart'][$pid])) { $qty_out = $_SESSION['cart'][$pid] + $qty1; } else { $qty = $qty1; } // add to the cart session variable $_SESSION['cart'][$pid] = $qty; // Display a message Thanks Lional Quote Link to comment https://forums.phpfreaks.com/topic/72732-shopping-carts/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.