Ajax is not getting data and starting the $_SESSION PHP/AJAX
<p>I have two dropdowns where ajax gets the value from it and send to my page calculates.php and then i will get a result based on both dropdown selection.
But its not working well.
The problem is that im getting a error that is saying </p>

<p><strong>Notice: Undefined index: icms in C:\xampp\htdocs\system\clientes\gallery\cart.php on line 159</strong></p>

<p><strong>Notice: Undefined index: icms in 
C:\xampp\htdocs\system\clientes\gallery\cart.php on line 160</strong></p>

<p>icms is a variable that holds the $_SESSION['icms'].
When i get the result i must store in session and get data from data base.
I dont know why i am getting this.
And my values are not returning.
my script</p>

<pre><code>$(document).ready(function(e){
  e.preventDefault();
    $('.fabric').on('change',function(e){
        var fabricID = $(this).val();
        console.log("fabric id_price is " + fabricID); //debugging
        if(fabricID){
           $.ajax({
                type:'GET',
                url:'calculates.php',
                data:'id_price='+fabricID,
                success:function(html){                                                          

                  // do nothing cuz i just need to combine with script bellow 
               //some closing tags

    $('.size').on('change',function(e){
      e.preventDefault();
        var sizeID = $(this).val();
        if(sizeID){
            $.ajax({
                type:'GET',
                url:'calculates.php',
                dataType: 'json',
                data:'size_id='+sizeID,

                success:function(html){
                  $(".icms" + id).text(data.val);
              //some closing tags
</code></pre>

<p>this is where i get my dropdown data and search database...
calculates.php</p>

<pre><code>header('Content-Type: application/json');
include_once '../incluedes/conn_cms.php'; 

if(isset($_GET["size_id"],$_GET["id_price"])){
    $the_size=$_GET["size_id"] ;
    $the_id_price=$_GET["id_price"] ;


 $query3 = "SELECT * FROM valores_almofadas 
            WHERE size='$the_size' 
            AND   price_id ='$the_id_price'";
  $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']=$ICMS;

  } echo $_SESSION['icms'];

}
</code></pre>

<p>and here where i am supouse to receive data from the result.
this below is my cart.php script</p>

<p><code>$value</code> holds quantity
and the <code>$id</code> holds the product row id.</p>

<p><strong>159</strong>   <code>&lt;td class="icms'.$id.'"&gt;R$:'.$_SESSION['icms'] .'&lt;/td&gt;</code></p>

<p><strong>160</strong>   <code>&lt;td class="total'.$id.'"&gt;'.$value * $_SESSION['icms'] .' &lt;/td&gt;</code></p>