Loading ...
Sorry, an error occurred while loading the content.

shopping cart problem

Expand Messages
  • Bijon
    hi experts, i have make a shopping cart. but it automatically unset when i am going to next page. any can help me. my code is...
    Message 1 of 1 , Apr 30 2:06 AM
    • 0 Attachment
      hi experts,
      i have make a shopping cart. but it automatically unset when i am going to next page. any can help me. my code is...

      <?php
      unset($_SESSION['cart']);

      $_SESSION['ORDEREVENTID'] = $_POST['eventid'];
      $event_id = $_POST['eventid'];
      //$_SESSION['ORDEREVENTID']= $purifier->purify($_REQUEST['eid']);
      //$event_id = $purifier->purify($_REQUEST['eid']);
      $grant_total_ticket = $_POST['grant_total_ticket'];
      $grant_total_taka = $_POST['grant_total_taka'];
      //print_r ($_POST['rowsnum']);
      $_SESSION['grand_total_ticket']=$grant_total_ticket;
      $_SESSION['grant_total_taka']=$grant_total_taka;
      foreach ($_POST['rowsnum'] as $key => $count) {
      //echo $count."<br />";
      $ticket_type_id = $_POST['ticket_type_id_' . $count];
      $qty = $_POST['qty_' . $count];
      $totalprice = $_POST['totalprice_' . $count];
      $Ticket_type = $_POST['Ticket_type_' . $count];
      $ticketprice=$_POST['price_'. $count];

      if (is_array($_SESSION['cart'])) {
      $max = count($_SESSION['cart']);
      $_SESSION['cart'][$max]['Event_id'] = $event_id;
      $_SESSION['cart'][$max]['ticket_type_id'] = $ticket_type_id;
      $_SESSION['cart'][$max]['qty'] = $qty;
      $_SESSION['cart'][$max]['totalprice'] = $totalprice;
      $_SESSION['cart'][$max]['Ticket_type'] = $Ticket_type;
      $_SESSION['cart'][$max]['ticketprice'] = $ticketprice;

      }
      else {

      $_SESSION['cart'] = array();
      $_SESSION['cart'][0]['Event_id'] = $event_id;
      $_SESSION['cart'][0]['ticket_type_id'] = $ticket_type_id;
      $_SESSION['cart'][0]['qty'] = $qty;
      $_SESSION['cart'][0]['totalprice'] = $totalprice;
      $_SESSION['cart'][0]['Ticket_type'] = $Ticket_type;
      $_SESSION['cart'][0]['ticketprice'] = $ticketprice;
      //echo "<br />max0->".$max;
      }
      }
      ?>
      <script type="text/javascript">
      <!--
      window.location = "<?php echo constant("baseurl"); ?>index.php/order-now"
      //-->
      </script>
    Your message has been successfully submitted and would be delivered to recipients shortly.