Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php header('Content-Type: application/json');
- include_once '../incluedes/conn_cms.php'; //sesion started in here
- //include_once 'cart.php';
- if(isset($_GET["size_id"],$_GET["fabric_id"],$_GET['prod_id'])){
- $size_id=$_GET["size_id"] ;
- $fabric_id=$_GET["fabric_id"] ;
- $id = $_GET['prod_id'];
- //$prodname = 'product_'.$prod;
- $query3 =" SELECT * FROM valores_almofadas
- WHERE size='$size_id'
- AND price_id ='$fabric_id'";
- $result = mysqli_query($conn,$query3);
- while($rows = mysqli_fetch_assoc($result)){
- if($_SESSION['estado'] == 'SP'){
- $ICMS = $rows['icms_7'];
- }else{
- $ICMS = $rows['icms_12'];
- }
- $_SESSION['icms'.$id]=$ICMS;
- }
- }
- $value = $_SESSION['product_'.$id];
- $return = new stdClass;
- $return->cost = $_SESSION['icms'.$id];
- $return->subtotal = number_format($value * $_SESSION['icms'.$id], 2, '.', '');
- die(json_encode($return));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement