Responsive Ad Area

Share This Post

test

How can I insert food menu with required condiments in the database using Jquery

How can I insert food menu with required condiments in the database using Jquery

I have problem It took almost 2 days and I can’t get any solution for this. I have last module that I should insert Order with Required Condiments. I found some example that they have required condiments but they use programming language is c#, I just translate the system to web application for just a practice purpose only.

Ex. https://www.youtube.com/watch?v=yt60-apBnJ4

Example

So guys this is my sample output in my web application.

The problem here is, when I click the button the required condiments duplicated based on how many main items have.

Ex. If I have 2 Main food menu orders, the insertion of required condiments will multiply 2x. So if that happen, what is the possible solution to solved my problem.?

My output

I will show you guys my submit button.

$('button#add_to_cart').on('click',function () {

var customer_id = $('#hidden_customer_id').val();

   var sub_item = $('#noun_chaining_order').find('tr.editCondiments');

   var main_item = $('#noun_chaining_order').find('tr.condimentParent').add(main_item).each(function(){

     var $tds_menu = $(this).find("td");

      Qty_menu = $tds_menu.eq(0).text(),

      append_customer_noun_order = $tds_menu.eq(1).text(),

      append_customer_noun_order_price = $tds_menu.eq(2).text();

       $.ajax({

          url: '/insert_wish_list_menu_order',
          type: 'post',

          data: {
            customer_id: customer_id,
            append_customer_noun_order: append_customer_noun_order,
            append_customer_noun_order_price: append_customer_noun_order_price,
          },

          success:function(response){

              console.log(response);

              var sub_item = $('#noun_chaining_order').find('tr.editCondiments').add(sub_item).each(function(){

                    var $tds_menu = $(this).find("td");

                    Qty_condiments = $tds_menu.eq(0).text(),

                    Item_condiments = $tds_menu.eq(1).text(),

                    Cost_condiments = $tds_menu.eq(2).text();

                    $.ajax({

                        url: '/insert_wish_list_menu_belong_condiments',
                        type: 'post',
                        data: {

                          Qty: Qty_condiments,
                          Item: Item_condiments,
                          Cost: Cost_condiments

                        },

                        success: function (response) {
                            console.log(response);
                        },

                        error: function (response) {
                          console.log(response);
                        }


                      });

              });

          },

          error:function(response){

            console.log(response);

          }


       })


});

});

In the result in the database was this.

database result


How can I insert food menu with required condiments in the database using Jquery
How can I insert food menu with required condiments in the database using Jquery
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar