templates/frontend/cart/js/toogle-setup.js.twig line 1

Open in your IDE?
  1. $(document).on('click', '.toggleProductionAndSetupCartView', function () {
  2.     $button = $(this);
  3.     let uuidCustomerAdvertisingArea = $button.data('uuid');
  4.     $.ajax({
  5.         url: "{{ path('app_frontend_cart_toogle-production-and-setup') }}",
  6.         method: "POST",
  7.         data: {
  8.             'uuidCustomerAdvertisingArea': uuidCustomerAdvertisingArea
  9.         },
  10.         success: function (response) {
  11.             if (response.area.withinSetup) {
  12.                 $button.children('i').removeClass().addClass('fal fa-minus-square');
  13.                 $button.prev('span.product-setup-price').text('zzgl. '+response.area.setupPrice+' {{ "app.currency_sign"|trans }}')
  14.             } else {
  15.                 $button.children('i').removeClass().addClass('fal fa-plus-square');
  16.                 $button.prev('span.product-setup-price').text('Für '+response.area.setupPrice+' {{ "app.currency_sign"|trans }} hinzufügen');
  17.             }
  18.             $('.'+uuidCustomerAdvertisingArea+'-product-price').text(response.area.pricePerPeriod+ ' {{ "app.currency_sign"|trans }}');
  19.             $('.checkout-box').find('span.total-price').text(response.cartTotal+' {{ "app.currency_sign"|trans }}');
  20.         }
  21.     });
  22. });