Jump to content

raptor30506090

Members
  • Posts

    156
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

raptor30506090's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi im very new at jquery so any info would be great What im trying to do is when a page is loaded i would like to refresh that page once more with jquery
  2. hi guys this seems to be a good one i thnik the problem is here <?php $_SESSION['cart'][] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity)); ?> how do i show a session with out the square brackets at the end of $_SESSION['cart']
  3. :'( May be not solved i can put 3 items in the cart all works great then the four one it gos wrong doing my head in here is the new code <?php if(isset($_POST['submit'])){ $id = $_POST['id']; $sleeve = $_POST['sleeve']; $colour = $_POST['colour']; $size = $_POST['size']; $action = $_POST['action']; $quantity = 1; } //IF NOT IN CART if(!isset($_SESSION['cart'])){ $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity)); }else{ foreach($_SESSION['cart'] as $key => $value){ //IF IT IS IN THE CART IM CHECKING TO SEE IF SAME if($value['id'] == $id && $value['colour'] == $colour && $value['size'] == $size){ // ADDING ONE TO THE CART IF SAME $quantity = $value['quantity']+=1; $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity)); }else{ // IF NOT THE SAME PUTTING THIS OUT $_SESSION['cart'] []= array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity)); } } } foreach($_SESSION['cart'] as $cart => $value){ foreach($value as $c => $v){ echo $v; } } ?> Any help work be ace
  4. Thank for your help i have now worked it out all working great
  5. Na sorry still the same as before cant see any diffrence must admit been posting this for some time with out any luck cheers for any help :-\
  6. ok then how do i go about fixing it i can only see it once like this $_SESSION['cart'][$productId][] = array('quantity' =
  7. Im making a shopping cart so my question is $query = mysql_query("SELECT * FROM colour WHERE colour_id=".$colourID); $query = mysql_query("SELECT * FROM products WHERE id=".$id); can i make a jion so i select the product and then make a join to SELECT the colour
  8. Hi guys new at this when the slide comes to the last image how do i make it go back to the first one cheers <div id="holder"> <div id="box"> <div class="1"><img src="test_image/1.jpg" width="520" height="248"></div> <div class="2"><img src="test_image/2.gif" width="520" height="248"></div> <div class="3"><img src="test_image/3.jpg" width="520" height="248"></div> <div class="4"><img src="test_image/4.jpg" width="520" height="248"></div> <div class="5"><img src="test_image/5.gif" width="520" height="248"></div> </div> <span><button id="left">«</button><button id="right">»</button></span> <div id="clear"></div> </div> <script type="text/javascript"> $("#left").click(function(){ $("#box").stop().animate({"left": "+=520px"}, "slow"); }); $("#right").click(function(){ $("#box").animate({"left": "-=520px"}, "slow"); }); </script>
  9. Still could do with some help question if im doing it so wrong can any one point me in the write root. what im trying to do is make a cart say t-shirt and have options for it like colour what they can select then if they choose same t-shirt but diffrent colour it add new product and dont over write last one any help would be great have been trying to do this for some time :'(
  10. No i didnt write this code it was given me from here
  11. This is the help i already have been given this is with comment thanks <?php if(isset($_POST['submit'])){ $productId = $_POST['productId']; $quantity = $_POST['quantity']; $size = $_POST['size']; $color = $_POST['color']; $price = $_POST['price']; //if the productID doesn't exist, just create it: if ( !isset($_SESSION['cart'][$productId]) ) { $_SESSION['cart'][$productId] = array(array('quantity' => $quantity, 'size' => $size, 'color' => $color, 'price' => $price)); } //product already exists, check to see if it's the same as another in the group: foreach ( $_SESSION['cart'][$productId] as &$product ) { //NOTE: If you want to override pricing with new tiers, you can remove 'price' from this comparison. You may also want to // fetch prices from the database when you DISPLAY the cart if you do bulk discounts if ( $product['price'] == $price && $product['color'] == $color && $product['size'] == $size ) { $product['quantity'] += $quantity; } } //if we've reached here, the productID is already in the cart but the current item is not a duplicate of an existing one: $_SESSION['cart'][$productId][] = array('quantity' => $quantity, 'size' => $size, 'color' => $color, 'price' => $price); foreach($_SESSION['cart'][$productId] as $prod => $value){ echo $value['size'] .' '.$value['price']; } //print_r($_SESSION['cart']); } ?>
  12. Or you could loop it <?php $team0 = 1; $team1 = 2; $team2 = 3; $teams = array(array('TeamA' => $team0, 'TeamB' => $team1, 'TeamC' => $team2)); sort($teams); foreach($teams as $team){ while(list($key, $list) = each($team)) { echo 'Team Results: ' . ' ' .$key . ' Points: ' .$list . '<br>'; }} ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.