app/template/plugin/SalesRestrictions42/default/Product/restrictions_js.twig line 1

Open in your IDE?
  1. {#
  2. * Plugin Name : SalesRestrictions4
  3. *
  4. * Copyright (C) BraTech Co., Ltd. All Rights Reserved.
  5. * http://www.bratech.co.jp/
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. #}
  10. <div id="sales_restrictions" style="display:none;">
  11. {{ include('Product/sales_restrictions_cart.twig') }}
  12. </div>
  13. <script>
  14. $(function() {
  15.     
  16.     let promise = new Promise((resolve, reject) => {
  17.         var hiddenIds = {{ hiddenIds }};
  18.         var product_id;
  19.     
  20.         for (var key in hiddenIds) {
  21.             product_id = hiddenIds[key];
  22.             $elem = $('form[id="productForm'+product_id+'"]');
  23.             $elem.after($('#sales_restrictions').html());
  24.             $elem.remove();
  25.         }
  26.         resolve();
  27.     }).then(() => {
  28.         const displayPrice = document.querySelectorAll('.list_price_area');
  29.         displayPrice.forEach( (el) => {
  30.             el.style.display = 'block';
  31.         });
  32.     })
  33.     
  34. });
  35. </script>