php - post product data if quantity more than zero -


how send data (product_id, quantity) of products quantity marked more 0?

i want category page this

example

<?php  if ( isset( $_post['product'] ) ) {      foreach ( $_post['product'] $product ) {         if ($product['q']>0) {             add_to_cart( $product['id'], $product['q'] )         }      } }  ?>  <form method="post" action="">      <input type="number" name="product[0][q]" value="0"/><input type="hidden" name="product[0][id]" value="11"/><br/>     <input type="number" name="product[1][q]" value="0"/><input type="hidden" name="product[1][id]" value="12"/><br/>     <input type="number" name="product[2][q]" value="0"/><input type="hidden" name="product[2][id]" value="13"/><br/>     <input type="number" name="product[3][q]" value="0"/><input type="hidden" name="product[3][id]" value="14"/><br/>      <input type="submit" value="send">  </form> 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -