Note that there are some explanatory texts on larger screens.

plurals
  1. POShopping cart in jquery with php and session
    primarykey
    data
    text
    <p>Good day!</p> <p>I'm now learning this jquery by creating a basic shopping cart were as add to cart buttons, remove items and clear buttons works in jquery.</p> <p>The function is to save the added items on session and can remove and clear also by jquery. I have an idea now on how the jquery works on adding the items. But not on removing a single item or to clear all of them on the cart.</p> <p>Any help, suggestion are much appreciated.</p> <p>thanks... :D</p> <p>Here is the code I have done so far on shopping cart. This is in two files the index.php and cart.php were the add to cart button already working except for remove and clear. Because I was not able to run the session yet.</p> <p>Here it is:</p> <pre><code>&lt;script type="text/javascript"&gt; // for ajax $(document).ready(function(){ $(".add").click(function(){ var id = $(this).attr("proid"); var item = $("#item"+id).val(); var brand = $("#brand"+id).val(); var price = $("#price"+id).val(); var quantity = $("#quantity"+id).val(); $.ajax({ type: "POST", url: "cart.php", data: "id="+ id + "&amp; item="+ item + "&amp; brand="+ brand +"&amp; price="+ price +"&amp; quantity="+ quantity, success: function(data){ $("#jcart").html(data); } }); //ajax return false; }); //click function //show empty table $("#jcart").load("jcart.php"); //--&gt; for options $(".remove").click(function(){ var id = $(this).attr("proid"); $.ajax({ type: "POST", url: "clear.php", data: "id="+ id, success: function(data){ $('#jcart').html(data) } }); }); $(".clear").click(function(){ $.ajax({ type: "POST", url: "clear.php", success: function(data){ $("#jcart").html(data) } }); }); }); &lt;/script&gt; </code></pre> <p>I'm making difficult with the session on how the items being save then retrieve. Any ideas or help will much appreciated...</p> <p>thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload