How to insert a record by clicking on the link using AJAX
If this is your request data for an AJAX POST: data: { action: ‘gs_order’, nonce_data: ajax_vars.nonce, product_groups: $(this).data(“pgid”), products: $(this).data(“pid”) }, Then you access product_groups and products like this: $data = [ ‘product_groups’ => $_POST[‘product_groups’], ‘products’ => $_POST[‘products’], ]; Just make sure you sanitize and escape the data as required. If they’re going to be … Read more