app/Plugin/ProductHide42/Resource/template/front/Cart/index.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of the ProductHide42 Plugin
  3. Copyright (C) 2023 Diezon.
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% block javascript %}
  8.     <script>
  9.         $(function () {
  10.             {% if totalQuantity > 0 %}
  11.                 {% for CartIndex,Cart in Carts %}
  12.                     {% for CartItem in Cart.CartItems %}
  13.                         {% set Product = CartItem.ProductClass.Product %}
  14.                         {% if Product.hidden %}
  15.                             var cartRowName = $('.ec-cartRow__name:has(a[href="{{ url('product_detail', {id : Product.id} ) }}"])');
  16.                             cartRowName.prepend('{{ Product.name }}');
  17.                             cartRowName.find('a').hide();
  18.                         {% endif %}
  19.                     {% endfor %}
  20.                 {% endfor %}
  21.             {% endif %}
  22.         });
  23.     </script>
  24. {% endblock javascript %}