Hello,
I am posting cart values in the database with ajax and would like to know if the GET function would work for update my cart. I have all the code in php working, just need to have a way to POST and then run my cartupdate.php
Would the below code be the right way of doing this please?
Thank you.
- <script>
- $("#form-items").submit(function(e) {
- $.ajax({
- type: "POST",
- url: "resources/templates/frontend/cart.php",
- data: $("#form-item").serialize(),
- success: function(data)
- {
- alert(data);
- }
- });
- $.get( "cartupdate.php", function( data ) {
- });
- e.preventDefault();
- });
- </script>