title: How can use coupon code to minus value from total price
body: <p><strong>This is my html part where I use coupon input</strong></p>
  
  <p><strong>IF need more code I'll provide</strong></p>
  
  <pre><code>Enter Coupon Code 
  
  
  
  &lt;input type="text" class="form" name="couponadd" id="couponadd" placeholder="Enter Your Coupon Code" oninput="myFunction()" style="width: -moz-available;" /&gt;
  </code></pre>
  
  <p><strong>Oninput I am getting the coupon code in script</strong></p>
  
  <pre><code>&lt;script&gt;
  function myFunction() {
   var getcoupon = document.getElementById("couponadd").value;
   var aftercoupn=0;
  </code></pre>
  
  <p><strong>if coupon code is gold then less 15 from total</strong></p>
  
  <pre><code> if(getcoupon == 'gold')
   {
   var aftercoupn = 15;
   document.getElementById("aftercoupan").innerHTML = '- $' + aftercoupn;
   alert('minus 15 dollers');
   }
  </code></pre>
  
  <p><strong>if coupon code is silver then less 10 from total</strong></p>
  
  <pre><code> else if(getcoupon == 'silver')
   {
    var aftercoupn = 10;
   document.getElementById("aftercoupan").innerHTML = '- $' +  aftercoupn;
    alert('minus 10 dollers');
   }
   else
   {
   }
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Iam getting price from php code loop</strong></p>
  
  <pre><code>echo  "&lt;ul id='sub'&gt;";
  if($Seats == null){ 
  echo '&lt;li class="BlankSeat" &gt;&lt;/li&gt;';
  }
  elseif($ticketType=='PINK' &amp;&amp; $ticketType == $_GET['type']){
  echo '&lt;li class="pink" id="pink" data-price="100" title="Row'.$Seats.'" name="'.$RowName.'" value="'.$Seats.'"&gt;&lt;/li&gt;';
  }
  
  else{
  echo '&lt;li class="orange" id="orange" data-price="200" title="Row'.$Seats.'" name="'.$RowName.'" value="'.$Seats.'"&gt;&lt;/li&gt;';
  }
  
  }
  
  echo "&lt;/ul&gt;";
  </code></pre>
  
  <p><strong>script code  from get price on click of li</strong></p>
  
  <pre><code>var total =0;
  var counter = 0;
  var price=0;
  $('li').click(function(e) {
  var price = $(this).attr('data-price');
  if click something
  {
  counter++;
  }else
  {
  counter --;
  }
  </code></pre>
  
  <p><strong>how can i use coupon code value here in total</strong></p>
  
  <pre><code>var total = parseFloat(price * counter);
  document.getElementById('demoPrice').innerHTML = '$' + total;
  }
  });
  </code></pre>