templates/front/product/view.html.twig line 1

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <link rel="manifest" href="{{ asset('assets/manifest.json') }}">
  5.     {#    <link rel="icon" href="assets/images/favicon/2.png" type="image/x-icon" />#}
  6.     {#    <link rel="apple-touch-icon" href="assets/images/favicon/2.png" />#}
  7.     <meta name="theme-color" content="#F45C2C" />
  8.     <meta name="apple-mobile-web-app-capable" content="yes" />
  9.     <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  10.     <meta name="apple-mobile-web-app-title" content="pcboomboom.rs" />
  11.     <meta name="msapplication-TileImage" content="{{ asset('assets/images/logo/favicon_io (2)/favicon.ico') }}" />
  12.     <meta name="msapplication-TileColor" content="#FFFFFF" />
  13.     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  14.     <link rel="preconnect" href="https://fonts.googleapis.com" />
  15.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  16.     <link rel="preconnect" href="https://fonts.googleapis.com" />
  17.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  18.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  19.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  20.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  21.     <meta name="description" content="
  22.     {% if product.metaDescription is not null%}
  23.         {{ product.metaDescription |trans }}
  24.     {% else %}
  25.         {{ constant('App\\Classes\\Data\\MetaTagsData::DESC') }}
  26.     {% endif %}">
  27.     <meta name="keywords" content="
  28.     {% if product.metaKeywords is not null%}
  29.         {{ product.metaKeywords |trans }}
  30.     {% else %}
  31.         {{ constant('App\\Classes\\Data\\MetaTagsData::KEYWORDS') }}
  32.     {% endif %}">
  33.     <meta name="author" content="pcboomboom.rs">
  34.     <link rel="icon" href="{{ asset('assets/images/logo/favicon_io (2)/favicon.ico') }}" type="image/x-icon">
  35.     <!-- Ako želite podržati i mobilne uređaje -->
  36.     <link rel="apple-touch-icon" href="{{ asset('assets/images/logo/favicon_io (2)/apple-touch-icon.png') }}">
  37.     <!-- facebook -->
  38.     <meta property="og:type" content="article" />
  39.     <meta property="og:title" content="{{ product.title |trans }} | pcboomboom.rs" />
  40.     <meta property="og:url" content="{{ app.request.uri }}" />
  41.     <meta property="og:image" content="{{ asset(product.mainImage.thumbnail500) }}"/>
  42.     <meta property="og:site_name" content="pcboomboom.rs - {{ constant('App\\Classes\\Data\\MetaTagsData::TITLE') }}"/>
  43.     <meta property="fb:admins" content="1285367254" />
  44.     <meta property="og:description" content="" />
  45.     <!-- ./facebook -->
  46.     <title>{{ product.title |trans }} - {{ constant('App\\Classes\\Data\\MetaTagsData::TITLE') }} | pcboomboom.rs</title>
  47.     <!-- Google font -->
  48.     <link rel="preconnect" href="https://fonts.gstatic.com">
  49.     <link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap" rel="stylesheet">
  50.     <!-- bootstrap css -->
  51.     <link id="rtl-link" rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/bootstrap.css') }}">
  52.     <!-- font-awesome css -->
  53.     <link rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/font-awesome.css') }}">
  54.     <!-- feather icon css -->
  55.     <link rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/feather-icon.css') }}">
  56.     <!--Plugin CSS file with desired skin-->
  57.     <link rel="stylesheet" href="{{ asset('assets/shop/assets/css/vendors/ion.rangeSlider.min.css') }}">
  58.     <!-- animation css -->
  59.     <link rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/animate.css') }}">
  60.     <!-- slick css -->
  61.     <link rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/slick/slick.css') }}">
  62.     <link rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/vendors/slick/slick-theme.css') }}">
  63.     <!-- Theme css -->
  64.     <link id="color-link" rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/demo2.css') }}">
  65.     <link id="color-link" rel="stylesheet" type="text/css" href="{{ asset('assets/shop/assets/css/demo1.css') }}">
  66. </head>
  67. <body class="theme-color1 light ltr">
  68. {% include 'front/include/header.html.twig' %}
  69. <!-- mobile fix menu -->
  70. {% include 'front/include/mobile_menu.html.twig' %}
  71. <div id="fb-root"></div>
  72. <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v14.0" nonce="kV2PhO6v"></script>
  73. <section class="breadcrumb-section section-b-space d-print-none">
  74.     <ul class="circles">
  75.         <li><img src="{{ asset('assets/shop/assets/circles/1.svg') }}"></li>
  76.         <li><img src="{{ asset('assets/shop/assets/circles/2.svg') }}"></li>
  77.         <li><img src="{{ asset('assets/shop/assets/circles/3.svg') }}"></li>
  78.         <li><img src="{{ asset('assets/shop/assets/circles/4.svg') }}"></li>
  79.         <li><img src="{{ asset('assets/shop/assets/circles/5.svg') }}"></li>
  80.         <li><img src="{{ asset('assets/shop/assets/circles/6.svg') }}"></li>
  81.         <li><img src="{{ asset('assets/shop/assets/circles/7.svg') }}"></li>
  82.         <li><img src="{{ asset('assets/shop/assets/circles/8.svg') }}"></li>
  83.         <li><img src="{{ asset('assets/shop/assets/circles/9.svg') }}"></li>
  84.         <li><img src="{{ asset('assets/shop/assets/circles/10.svg') }}"></li>
  85.     </ul>
  86.     <div class="container">
  87.         <div class="row">
  88.             <div class="col-12">
  89.                 <h3>PROIZVOD</h3>
  90.                 <ol class="breadcrumb">
  91.                     <li class="breadcrumb-item">
  92.                         <a href="{{ path('app_shop_home') }}">
  93.                             <i class="fas fa-home"></i>
  94.                         </a>
  95.                     </li>
  96.                     <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop_all') }}" class="text-dark">PRODAVNICA</a></li>
  97.                     {% if category.parent is not null %}
  98.                         {% if category.parent.parent is not null %}
  99.                             {% if category.parent.parent.parent is not null %}
  100.                                 {% if category.parent.parent.parent.parent is not null %}
  101.                                     <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop', {id:category.parent.parent.parent.parent.id}) }}" class="text-dark">{{ category.parent.parent.parent.parent.title }}</a></li>
  102.                                 {% endif %}
  103.                                 <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop', {id:category.parent.parent.parent.id}) }}" class="text-dark">{{ category.parent.parent.parent.title }}</a></li>
  104.                             {% endif %}
  105.                             <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop', {id:category.parent.parent.id}) }}" class="text-dark">{{ category.parent.parent.title }}</a></li>
  106.                         {% endif %}
  107.                         <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop', {id:category.parent.id}) }}" class="text-dark">{{ category.parent.title }}</a></li>
  108.                     {% endif %}
  109.                     <li class="breadcrumb-item" aria-current="page"><a href="{{ path('app_shop', {id:category.id}) }}" class="text-dark">{{ category.title }}</a></li>
  110.                     <li class="breadcrumb-item active" aria-current="page">{{ product.title |trans }}</li>
  111.                 </ol>
  112.             </div>
  113.         </div>
  114.     </div>
  115. </section>
  116. <section>
  117.     <div class="container">
  118.         <div class="row gx-4 gy-5">
  119.             <div class="col-12">
  120.                 <div class="details-items">
  121.                     <div class="row g-4">
  122.                         <div class="col-md-6">
  123.                             <div class="row">
  124.                                 <div class="col-lg-2 d-print-none">
  125.                                     <div class="details-image-vertical black-slide rounded">
  126.                                         <div>
  127.                                             <img src="{{ asset(product.mainImage.thumbnail100) }}"
  128.                                                  class="img-fluid blur-up lazyload" alt="">
  129.                                         </div>
  130.                                         {% if not product.image.empty %}
  131.                                             {% for img in product.image %}
  132.                                                 <div>
  133.                                                     <img src="{{ asset(img.thumbnail100) }}"
  134.                                                          class="img-fluid blur-up lazyload" alt="">
  135.                                                 </div>
  136.                                             {% endfor %}
  137.                                         {% endif %}
  138.                                     </div>
  139.                                 </div>
  140.                                 <div class="col-lg-10">
  141.                                     <div class="details-image-1 ratio_asos">
  142.                                         <div>
  143.                                             <img src="{{ asset(product.mainImage.thumbnail500) }}" id="zoom_00"
  144.                                                  data-zoom-image="{{ asset(product.mainImage.thumbnail500) }}"
  145.                                                  class="img-fluid w-100 image_zoom_cls-0 blur-up lazyload" alt="">
  146.                                         </div>
  147.                                         {% if not product.image.empty %}
  148.                                             {% for img in product.image %}
  149.                                                 <div>
  150.                                                     <img src="{{ asset(img.thumbnail500) }}" id="zoom_0{{ loop.index }}"
  151.                                                          data-zoom-image="{{ asset(img.thumbnail500) }}"
  152.                                                          class="img-fluid w-100 image_zoom_cls-0 blur-up lazyload" alt="">
  153.                                                 </div>
  154.                                             {% endfor %}
  155.                                         {% endif %}
  156.                                     </div>
  157.                                 </div>
  158.                             </div>
  159.                         </div>
  160.                         <div class="col-md-6">
  161.                             <div class="cloth-details-size">
  162.                                 <div class="details-image-concept">
  163.                                     <h3 class="text-muted">{{ product.category.title }}</h3>
  164.                                     <h2>{{ product.title }} <a href="{{ path('app_product_pdf', {id:product.id}) }}"><i class="fa fa-file-pdf mx-2"></i></a></h2>
  165.                                 </div>
  166.                                 <div class="label-section">
  167.                                     {% if product.new %}
  168.                                         <span class="label label-black">Novo</span>
  169.                                     {% endif %}
  170.                                     {% if product.discount %}
  171.                                         <span class="label label-theme">Popust</span>
  172.                                     {% endif %}
  173.                                     {% if product.superProduct %}
  174.                                         <span class="label label-theme">Super proizvod</span>
  175.                                     {% endif %}
  176.                                     {% if product.outOfStock %}
  177.                                         <span class="label label-theme">Nema na stanju</span>
  178.                                     {% endif %}
  179.                                     {% if product.isOutlet %}
  180.                                         <span class="label label-black">Outlet</span>
  181.                                     {% endif %}
  182.                                 </div>
  183.                                 {% if product.discount %}
  184.                                     <h3 class="price-detail">{{ ((product.pricePDV  | number_format(2, '.', ','))) }} RSD
  185.                                         <del>{{ ((product.price * ((product.vat/100) + 1)) | round)  | number_format(2, '.', ',') }} RSD</del>
  186.                                     </h3>
  187.                                 {% else %}
  188.                                     <h3 class="price-detail">{{ ((product.pricePDV  | number_format(2, '.', ','))) }} RSD</h3>
  189.                                 {% endif %}
  190.                                 <div id="selectSize" class="addeffect-section product-description border-product">
  191.                                     <h6 class="product-title size-text">Proizvođač</h6>
  192.                                     <div class="size-box">
  193.                                         <h6 class="product-title hurry-title d-block">{{ product.factory.title }}</h6>
  194.                                     </div>
  195.                                     {#                                    <h6 class="product-title size-text">Dobavljač</h6>#}
  196.                                     {#                                    <div class="size-box">#}
  197.                                     {#                                        <h6 class="product-title hurry-title d-block">{{ product.vendor.title }}</h6>#}
  198.                                     {#                                    </div>#}
  199.                                     <h6 class="product-title size-text">Atributi</h6>
  200.                                     {% set attributes = product.attribute %}
  201.                                     {% if not attributes.empty %}
  202.                                         {% set attributes = attributes|slice(0,9) %}
  203.                                         {% set chunkSize = 3 %}
  204.                                         {% set totalChunks = (attributes|length / chunkSize)|round(0, 'ceil') %}
  205.                                         {% for i in 0..(totalChunks - 1) %}
  206.                                             <div class="size-box">
  207.                                                 {% for atr in attributes|slice(i * chunkSize, chunkSize) %}
  208.                                                     <span class="label label-theme">{{ atr.title }} - {{ atr.value }}</span>
  209.                                                 {% endfor %}
  210.                                             </div>
  211.                                         {% endfor %}
  212.                                     {% endif %}
  213.                                     <h6 class="product-title size-text">Šifra proizvoda</h6>
  214.                                     <div class="size-box">
  215.                                         <h6 class="product-title hurry-title d-block">#{{ product.sku }} - {{ product.vendor.id }}</h6>
  216.                                     </div>
  217.                                     <h6 class="product-title size-text">Barkod</h6>
  218.                                     <div class="size-box">
  219.                                         <h6 class="product-title hurry-title d-block">{{ product.barcode }}</h6>
  220.                                     </div>
  221.                                     {#                                    <h6 class="product-title size-text">Te</h6>#}
  222.                                     {#                                    <div class="size-box">#}
  223.                                     {#                                        <h6 class="product-title hurry-title d-block">{{ product.weight | round }} kg</h6>#}
  224.                                     {#                                    </div>#}
  225.                                     {% if product.connected is not null %}
  226.                                         <div class="color-image">
  227.                                             <div class="image-select">
  228.                                                 <h5>Povezani proizvod:</h5>
  229.                                                 <ul class="image-section">
  230.                                                     <li>
  231.                                                         <a href="{{ path('app_shop_product_view', {id: product.connected.id }) }}">
  232.                                                             <img src="{{ asset(product.connected.mainImage.thumbnail100) }}"
  233.                                                                  class="img-fluid blur-up lazyload" alt="">
  234.                                                         </a>
  235.                                                     </li>
  236.                                                 </ul>
  237.                                             </div>
  238.                                         </div>
  239.                                     {% endif %}
  240.                                     <h6 class="product-title product-title-2 d-block d-print-none">Količina</h6>
  241.                                     {% if not product.outOfStock %}
  242.                                     <form id="add-to-cart-form" method="post">
  243.                                         <input name="pid" type="hidden" id="pid" value="{{ product.id }}"/>
  244.                                         <div class="qty-box d-print-none">
  245.                                             <div class="input-group">
  246.                                                 <span class="input-group-prepend">
  247.                                                     <button type="button" class="btn quantity-left-minus" data-type="minus" data-field="">
  248.                                                         <i class="fas fa-minus"></i>
  249.                                                     </button>
  250.                                                 </span>
  251.                                                 <input type="text" name="quantity" class="form-control input-number" value="1">
  252.                                                 <span class="input-group-prepend">
  253.                                                         <button type="button" class="btn quantity-right-plus" data-type="plus" data-field="">
  254.                                                             <i class="fas fa-plus"></i>
  255.                                                         </button>
  256.                                                 </span>
  257.                                             </div>
  258.                                         </div>
  259.                                 </div>
  260.                                 <div class="product-buttons d-print-none">
  261.                                     {% if app.user %}
  262.                                         <a href="#" class="btn btn-solid" id="wishList" data-product-id="{{ product.id }}">
  263.                                             <i class="fa fa-bookmark fz-16 me-2"></i>
  264.                                             <span>Dodajte u omiljene</span>
  265.                                         </a>
  266.                                     {% endif %}
  267.                                     <button type="submit" id="cartEffect" class="btn btn-solid hover-solid btn-animation">
  268.                                         <i class="fa fa-shopping-cart"></i>
  269.                                         <span style="font-weight: bold;">Dodajte u korpu</span>
  270.                                     </button>
  271.                                 </div>
  272.                                 </form>
  273.                                 {% else %}
  274.                                 <input name="pid" type="hidden" id="pid" value="{{ product.id }}"/>
  275.                                 <div class="qty-box d-print-none">
  276.                                     <div class="input-group">
  277.                                                     <span class="input-group-prepend">
  278.                                                         <button type="button" disabled class="btn quantity-left-minus" data-type="minus" data-field="">
  279.                                                             <i class="fas fa-minus"></i>
  280.                                                         </button>
  281.                                                     </span>
  282.                                         <input type="text" name="quantity" disabled class="form-control input-number"
  283.                                                value="1">
  284.                                         <span class="input-group-prepend">
  285.                                                             <button type="button" class="btn quantity-right-plus"
  286.                                                                     data-type="plus" disabled data-field="">
  287.                                                                 <i class="fas fa-plus"></i>
  288.                                                             </button>
  289.                                                         </span>
  290.                                     </div>
  291.                                 </div>
  292.                             </div>
  293.                             <div class="product-buttons d-print-none">
  294.                                 {% if app.user %}
  295.                                     <a href="#" class="btn btn-solid" id="wishList" data-product-id="{{ product.id }}">
  296.                                         <i class="fa fa-bookmark fz-16 me-2"></i>
  297.                                         <span>Dodajte u omiljene</span>
  298.                                     </a>
  299.                                 {% endif %}
  300.                                 <button type="submit" id="cartEffect" disabled
  301.                                         class="btn btn-solid hover-solid btn-animation">
  302.                                     <i class="fa fa-shopping-cart"></i>
  303.                                     <span style="font-weight: bold;">Dodajte u korpu</span>
  304.                                 </button>
  305.                             </div>
  306.                             {% endif %}
  307.                             <ul class="product-count shipping-order d-print-none">
  308.                                 <li>
  309.                                     <img src="{{ asset('assets/shop/assets/images/gif/truck.png') }}" class="img-fluid blur-up lazyload" alt="image">
  310.                                     {#                                            <span class="lang">{{ product.deliveryDesc }}</span> / <span class="lang">&nbsp;{{ product.daysDelivery }} radna dana&nbsp;</span>#}
  311.                                     {#                                            <span class="lang">&nbsp;{{ product.priceDelivery | number_format(2, '.', ',') }} RSD</span>#}
  312.                                     <span class="lang"><span class="lang">&nbsp;Isporuka do 7 radnih dana.&nbsp;</span>
  313.                                             <span class="lang">&nbsp;Dostavu plaćate naknadno kuriru pri preuzimanju pošiljke.</span>
  314.                                 </li>
  315.                             </ul>
  316.                             <div class="border-product d-print-none">
  317.                                 <h6 class="product-title d-block">Podelite</h6>
  318.                                 <div class="product-icon">
  319.                                     <ul class="product-social">
  320.                                         <li>
  321.                                             {#                                            <div  data-href="https://pcboomboom.rs{{ path('app_shop_product_view', {id: product.id }) }}" data-layout="button_count" data-size="small">#}
  322.                                             {#                                                <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fpcboomboom.rs%2Fproizvod" class="fb-xfbml-parse-ignore">#}
  323.                                             {#                                                    <i class="fab fa-facebook-f"></i>#}
  324.                                             {#                                                </a>#}
  325.                                             {#                                            </div>#}
  326.                                             <div class="fb-share-button" data-href="https://pcboomboom.rs{{ path('app_shop_product_view', {id: product.id }) }}" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Podelite</a></div>
  327.                                             {#                                            <div class="fb-share-button" data-href="http://prikolicacentar.rs/proizvod/{{ product.id }}/" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>#}
  328.                                             {#                                            <div  data-href="http://pcboomboom.rs/proizvod" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore"><i class="fab fa-facebook-f"></i></a></div>#}
  329.                                             {#                                            <div  data-href="http://pcboomboom.rs/proizvod/{{ product.id }}/" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore"><i class="fab fa-facebook-f"></i></a></div>#}
  330.                                             {#
  331.                                             <a href="#">
  332.                                                 <i class="fab fa-facebook-f"></i>
  333.                                             </a>
  334.                                         </li>
  335.                                         <li>
  336.                                             <a href="https://www.google.com/">
  337.                                                 <i class="fab fa-google-plus-g"></i>
  338.                                             </a>
  339.                                         </li>
  340.                                         <li>
  341.                                             <a href="https://twitter.com/">
  342.                                                 <i class="fab fa-twitter"></i>
  343.                                             </a>
  344.                                         </li>
  345.                                         <li>
  346.                                             <a href="https://www.instagram.com/">
  347.                                                 <i class="fab fa-instagram"></i>
  348.                                             </a>
  349.                                         </li>
  350.                                         <li class="pe-0">
  351.                                             <a href="https://www.google.com/">
  352.                                                 <i class="fas fa-rss"></i>
  353.                                             </a>
  354.                                         </li>
  355.                                     </ul>
  356.                                 </div>
  357.                             </div>
  358. {#                            <div class="border-product">#}
  359.                                             {#                                    <div class="product-icon">#}
  360.                                             {#                                        <ul class="product-social">#}
  361.                                             {#                                            <li>#}
  362.                                             {#                                                <div class="fb-share-button" data-href="http://pcboomboom.rs/proizvod" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>#}
  363.                                             {#                                                <div class="fb-share-button" data-href="http://pcboomboom.rs/proizvod/{{ product.id }}/" data-layout="button_count" data-size="small"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>#}
  364.                                             {#                                            </li>#}
  365.                                             {#                                        </ul>#}
  366.                                             {#                                    </div>#}
  367.                                             {#                                </div>#}
  368.                                 </div>
  369.                             </div>
  370.                         </div>
  371.                     </div>
  372.                 </div>
  373.                 <div id="toast-container" style="position: fixed; top: 20px; right: 20px; z-index: 9999;"></div>
  374.                 <div class="col-12 mb-4">
  375.                     <div class="cloth-review">
  376.                         <nav>
  377.                             <div class="nav nav-tabs" id="nav-tab" role="tablist">
  378.                                 <button class="nav-link active" id="nav-speci-tab" data-bs-toggle="tab" data-bs-target="#desc" type="button">Specifikacija</button>
  379.                                 <button class="nav-link d-print-none" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#opt" type="button">Deklaracija</button>
  380.                                 <button class="nav-link d-print-none" id="nav-contact-tab" data-bs-toggle="tab" data-bs-target="#review" type="button">Komentari</button>
  381.                             </div>
  382.                         </nav>
  383.                         <div class="tab-content" id="nav-tabContent">
  384.                             <div class="tab-pane fade show active" id="desc">
  385.                                 <div class="mb-4 table-responsive">
  386.                                     {{ product.description |raw }}
  387.                                 </div>
  388.                             </div>
  389.                             <div class="tab-pane fade " id="opt">
  390.                                 <div class="table-responsive mb-4">
  391.                                     {{ product.options |raw }}
  392.                                 </div>
  393.                             </div>
  394.                             <div class="tab-pane fade" id="review">
  395.                                 <div class="row g-4">
  396.                                     {% if app.user %}
  397.                                         <form class="row" id="commentForm">
  398.                                             <div class="col-lg-2">
  399.                                                 <div class="d-block my-3">
  400.                                                     <div class="form-check custome-radio-box">
  401.                                                         <input class="form-check-input" type="radio" name="rating" id="credit" value="1">
  402.                                                         <label class="form-check-label" for="credit">
  403.                                                             <ul class="rating d-inline-block">
  404.                                                                 <li>
  405.                                                                     <i class="fas fa-star theme-color"></i>
  406.                                                                 </li>
  407.                                                                 <li>
  408.                                                                     <i class="fas fa-star"></i>
  409.                                                                 </li>
  410.                                                                 <li>
  411.                                                                     <i class="fas fa-star"></i>
  412.                                                                 </li>
  413.                                                                 <li>
  414.                                                                     <i class="fas fa-star"></i>
  415.                                                                 </li>
  416.                                                                 <li>
  417.                                                                     <i class="fas fa-star"></i>
  418.                                                                 </li>
  419.                                                             </ul>
  420.                                                         </label>
  421.                                                     </div>
  422.                                                 </div>
  423.                                                 <div class="d-block my-3">
  424.                                                     <div class="form-check custome-radio-box">
  425.                                                         <input class="form-check-input" type="radio" name="rating" id="credit" value="2">
  426.                                                         <label class="form-check-label" for="credit">
  427.                                                             <ul class="rating d-inline-block">
  428.                                                                 <li>
  429.                                                                     <i class="fas fa-star theme-color"></i>
  430.                                                                 </li>
  431.                                                                 <li>
  432.                                                                     <i class="fas fa-star theme-color"></i>
  433.                                                                 </li>
  434.                                                                 <li>
  435.                                                                     <i class="fas fa-star"></i>
  436.                                                                 </li>
  437.                                                                 <li>
  438.                                                                     <i class="fas fa-star"></i>
  439.                                                                 </li>
  440.                                                                 <li>
  441.                                                                     <i class="fas fa-star"></i>
  442.                                                                 </li>
  443.                                                             </ul>
  444.                                                         </label>
  445.                                                     </div>
  446.                                                 </div>
  447.                                                 <div class="d-block my-3">
  448.                                                     <div class="form-check custome-radio-box">
  449.                                                         <input class="form-check-input" type="radio" name="rating" id="credit" value="3">
  450.                                                         <label class="form-check-label" for="credit">
  451.                                                             <ul class="rating d-inline-block">
  452.                                                                 <li>
  453.                                                                     <i class="fas fa-star theme-color"></i>
  454.                                                                 </li>
  455.                                                                 <li>
  456.                                                                     <i class="fas fa-star theme-color"></i>
  457.                                                                 </li>
  458.                                                                 <li>
  459.                                                                     <i class="fas fa-star theme-color"></i>
  460.                                                                 </li>
  461.                                                                 <li>
  462.                                                                     <i class="fas fa-star"></i>
  463.                                                                 </li>
  464.                                                                 <li>
  465.                                                                     <i class="fas fa-star"></i>
  466.                                                                 </li>
  467.                                                             </ul>
  468.                                                         </label>
  469.                                                     </div>
  470.                                                 </div>
  471.                                                 <div class="d-block my-3">
  472.                                                     <div class="form-check custome-radio-box">
  473.                                                         <input class="form-check-input" type="radio" name="rating" id="credit" value="4">
  474.                                                         <label class="form-check-label" for="credit">
  475.                                                             <ul class="rating d-inline-block">
  476.                                                                 <li>
  477.                                                                     <i class="fas fa-star theme-color"></i>
  478.                                                                 </li>
  479.                                                                 <li>
  480.                                                                     <i class="fas fa-star theme-color"></i>
  481.                                                                 </li>
  482.                                                                 <li>
  483.                                                                     <i class="fas fa-star theme-color"></i>
  484.                                                                 </li>
  485.                                                                 <li>
  486.                                                                     <i class="fas fa-star theme-color"></i>
  487.                                                                 </li>
  488.                                                                 <li>
  489.                                                                     <i class="fas fa-star"></i>
  490.                                                                 </li>
  491.                                                             </ul>
  492.                                                         </label>
  493.                                                     </div>
  494.                                                 </div>
  495.                                                 <div class="d-block my-3">
  496.                                                     <div class="form-check custome-radio-box">
  497.                                                         <input class="form-check-input" type="radio" name="rating" id="credit" value="5">
  498.                                                         <label class="form-check-label" for="credit">
  499.                                                             <ul class="rating d-inline-block">
  500.                                                                 <li>
  501.                                                                     <i class="fas fa-star theme-color"></i>
  502.                                                                 </li>
  503.                                                                 <li>
  504.                                                                     <i class="fas fa-star theme-color"></i>
  505.                                                                 </li>
  506.                                                                 <li>
  507.                                                                     <i class="fas fa-star theme-color"></i>
  508.                                                                 </li>
  509.                                                                 <li>
  510.                                                                     <i class="fas fa-star theme-color"></i>
  511.                                                                 </li>
  512.                                                                 <li>
  513.                                                                     <i class="fas fa-star theme-color"></i>
  514.                                                                 </li>
  515.                                                             </ul>
  516.                                                         </label>
  517.                                                     </div>
  518.                                                 </div>
  519.                                             </div>
  520.                                             <div class="col-lg-10">
  521.                                                 <div class="review-box">
  522.                                                     <div class="row g-4">
  523.                                                         <div class="col-12 col-md-6">
  524.                                                             <input hidden="hidden" name="member" value="{{ app.user.id }}">
  525.                                                             <label class="mb-1" for="name">Ime</label>
  526.                                                             <input type="text" class="form-control" id="name"
  527.                                                                    placeholder="Unesite Vaše ime" required value="{{ app.user.fullName }}">
  528.                                                         </div>
  529.                                                         <div class="col-12 col-md-6">
  530.                                                             <label class="mb-1" for="id">Email</label>
  531.                                                             <input type="email" class="form-control" id="id"
  532.                                                                    placeholder="Unesite Vaš email" required value="{{ app.user.email }}">
  533.                                                         </div>
  534.                                                         <div class="col-12">
  535.                                                             <label class="mb-1" for="comments">Komentar</label>
  536.                                                             <textarea name="comment" class="form-control" placeholder="Ostavite komentar" id="comments" style="height: 100px" required></textarea>
  537.                                                         </div>
  538.                                                         <div class="col-12">
  539.                                                             <button type="submit" class="btn default-light-theme default-theme default-theme-2">Sačuvajte</button>
  540.                                                         </div>
  541.                                                     </div>
  542.                                                 </div>
  543.                                             </div>
  544.                                         </form>
  545.                                     {% else %}
  546.                                         <div class="col-lg-12">
  547.                                             <div class="customer-rating">
  548.                                                 <h3>Morate biti prijavljeni da bi mogli ostavljati komentare.</h3>
  549.                                             </div>
  550.                                         </div>
  551.                                     {% endif %}
  552.                                     <div class="col-12 mt-4 mb-4">
  553.                                         <div class="customer-review-box">
  554.                                             {% if productComments is not empty %}
  555.                                                 <h4>Predhodni komentari</h4>
  556.                                                 {% for comm in productComments %}
  557.                                                     {% if not comm.isSuspended %}
  558.                                                         <div class="customer-section">
  559.                                                             <div class="customer-details">
  560.                                                                 <h5>{{ comm.createdBy.fullName }}</h5>
  561.                                                                 {% if comm.ocena is not null %}
  562.                                                                     {% if comm.ocena == 1 %}
  563.                                                                         <ul class="rating my-2 d-inline-block">
  564.                                                                             <li>
  565.                                                                                 <i class="fas fa-star theme-color"></i>
  566.                                                                             </li>
  567.                                                                             <li>
  568.                                                                                 <i class="fas fa-star"></i>
  569.                                                                             </li>
  570.                                                                             <li>
  571.                                                                                 <i class="fas fa-star"></i>
  572.                                                                             </li>
  573.                                                                             <li>
  574.                                                                                 <i class="fas fa-star"></i>
  575.                                                                             </li>
  576.                                                                             <li>
  577.                                                                                 <i class="fas fa-star"></i>
  578.                                                                             </li>
  579.                                                                         </ul>
  580.                                                                     {% endif %}
  581.                                                                     {% if comm.ocena == 2 %}
  582.                                                                         <ul class="rating my-2 d-inline-block">
  583.                                                                             <li>
  584.                                                                                 <i class="fas fa-star theme-color"></i>
  585.                                                                             </li>
  586.                                                                             <li>
  587.                                                                                 <i class="fas fa-star theme-color"></i>
  588.                                                                             </li>
  589.                                                                             <li>
  590.                                                                                 <i class="fas fa-star"></i>
  591.                                                                             </li>
  592.                                                                             <li>
  593.                                                                                 <i class="fas fa-star"></i>
  594.                                                                             </li>
  595.                                                                             <li>
  596.                                                                                 <i class="fas fa-star"></i>
  597.                                                                             </li>
  598.                                                                         </ul>
  599.                                                                     {% endif %}
  600.                                                                     {% if comm.ocena == 3 %}
  601.                                                                         <ul class="rating my-2 d-inline-block">
  602.                                                                             <li>
  603.                                                                                 <i class="fas fa-star theme-color"></i>
  604.                                                                             </li>
  605.                                                                             <li>
  606.                                                                                 <i class="fas fa-star theme-color"></i>
  607.                                                                             </li>
  608.                                                                             <li>
  609.                                                                                 <i class="fas fa-star theme-color"></i>
  610.                                                                             </li>
  611.                                                                             <li>
  612.                                                                                 <i class="fas fa-star"></i>
  613.                                                                             </li>
  614.                                                                             <li>
  615.                                                                                 <i class="fas fa-star"></i>
  616.                                                                             </li>
  617.                                                                         </ul>
  618.                                                                     {% endif %}
  619.                                                                     {% if comm.ocena == 4 %}
  620.                                                                         <ul class="rating my-2 d-inline-block">
  621.                                                                             <li>
  622.                                                                                 <i class="fas fa-star theme-color"></i>
  623.                                                                             </li>
  624.                                                                             <li>
  625.                                                                                 <i class="fas fa-star theme-color"></i>
  626.                                                                             </li>
  627.                                                                             <li>
  628.                                                                                 <i class="fas fa-star theme-color"></i>
  629.                                                                             </li>
  630.                                                                             <li>
  631.                                                                                 <i class="fas fa-star theme-color"></i>
  632.                                                                             </li>
  633.                                                                             <li>
  634.                                                                                 <i class="fas fa-star"></i>
  635.                                                                             </li>
  636.                                                                         </ul>
  637.                                                                     {% endif %}
  638.                                                                     {% if comm.ocena == 5 %}
  639.                                                                         <ul class="rating my-2 d-inline-block">
  640.                                                                             <li>
  641.                                                                                 <i class="fas fa-star theme-color"></i>
  642.                                                                             </li>
  643.                                                                             <li>
  644.                                                                                 <i class="fas fa-star theme-color"></i>
  645.                                                                             </li>
  646.                                                                             <li>
  647.                                                                                 <i class="fas fa-star theme-color"></i>
  648.                                                                             </li>
  649.                                                                             <li>
  650.                                                                                 <i class="fas fa-star theme-color"></i>
  651.                                                                             </li>
  652.                                                                             <li>
  653.                                                                                 <i class="fas fa-star theme-color"></i>
  654.                                                                             </li>
  655.                                                                         </ul>
  656.                                                                     {% endif %}
  657.                                                                 {% endif %}
  658.                                                                 <p class="font-light">{{ comm.comment }}</p>
  659.                                                                 <p class="date-custo font-light">- {{ comm.created | date("d.m.Y") }}</p>
  660.                                                             </div>
  661.                                                         </div>
  662.                                                     {% endif %}
  663.                                                 {% endfor %}
  664.                                             {% else %}
  665.                                                 <h4>Ovaj proizvod nije komentarisan. Budite prvi koji će ostaviti mišljenje o proizvodu.</h4>
  666.                                             {% endif %}
  667.                                         </div>
  668.                                     </div>
  669.                                 </div>
  670.                             </div>
  671.                         </div>
  672.                     </div>
  673.                 </div>
  674.             </div>
  675.         </div>
  676. </section>
  677. <!-- Shop Section end -->
  678. {{ render(controller('App\\Controller\\shop\\ProductController::productsCategory', { category: product.category } )) }}
  679. <!-- Newsletter modal start -->
  680. {% include 'front/include/subscribe.html.twig' %}
  681. <!-- Newsletter modal end -->
  682. <!-- footer start -->
  683. {% include 'front/include/footer.html.twig' %}
  684. <!-- footer end -->
  685. <!-- tap to top Section Start -->
  686. {% include 'front/include/top.html.twig' %}
  687. <!-- tap to top Section End -->
  688. <div class="bg-overlay"></div>
  689. <!-- latest jquery-->
  690. <script src="{{ asset('assets/shop/assets/js/jquery-3.5.1.min.js') }}"></script>
  691. <!-- Add To Home js -->
  692. <script src="{{ asset('pwa.js') }}"></script>
  693. <!-- Bootstrap js-->
  694. <script src="{{ asset('assets/shop/assets/js/bootstrap/bootstrap.bundle.min.js') }}"></script>
  695. <!-- feather icon js-->
  696. <script src="{{ asset('assets/shop/assets/js/feather/feather.min.js') }}"></script>
  697. <!-- lazyload js-->
  698. <script src="{{ asset('assets/shop/assets/js/lazysizes.min.js') }}"></script>
  699. <!-- Slick js-->
  700. <script src="{{ asset('assets/shop/assets/js/slick/slick.js') }}"></script>
  701. <script src="{{ asset('assets/shop/assets/js/slick/slick-animation.min.js') }}"></script>
  702. <script src="{{ asset('assets/shop/assets/js/slick/custom_slick.js') }}"></script>
  703. <!-- Notify js-->
  704. <script src="{{ asset('assets/shop/assets/js/bootstrap/bootstrap-notify.min.js') }}"></script>
  705. <!-- timer js -->
  706. {#<script src="{{ asset('assets/shop/assets/js/timer.js') }}"></script>#}
  707. <!-- sticky cart bottom js-->
  708. <script src="{{ asset('assets/shop/assets/js/sticky-cart-bottom.js') }}"></script>
  709. <!-- sticky cart bottom js-->
  710. <script src="{{ asset('assets/shop/assets/js/check-box-select.js') }}"></script>
  711. <!-- Zoom Js -->
  712. <script src="{{ asset('assets/shop/assets/js/jquery.elevatezoom.js') }}"></script>
  713. <script src="{{ asset('assets/shop/assets/js/zoom-filter.js') }}"></script>
  714. <!--Plugin JavaScript file-->
  715. {#<script src="{{ asset('assets/shop/assets/js/ion.rangeSlider.min.js') }}"></script>#}
  716. <!-- Filter Hide and show Js -->
  717. <script src="{{ asset('assets/shop/assets/js/filter.js') }}"></script>
  718. <!-- add to cart modal resize -->
  719. {#<script src="{{ asset('assets/shop/assets/js/cart_modal_resize.js') }}"></script>#}
  720. <!-- Notify js-->
  721. <script src="{{ asset('assets/shop/assets/js/bootstrap/bootstrap-notify.min.js') }}"></script>
  722. <!-- script js -->
  723. {#<script src="{{ asset('assets/shop/assets/js/theme-setting.js') }}"></script>#}
  724. <script src="{{ asset('assets/shop/assets/js/script.js') }}"></script>
  725. <script>
  726.     $(function() {
  727.         $('.cloth-review .tab-pane table').each(function() {
  728.             console.log('Found table:', this);
  729.             // Uklonite sve prethodne inline stilove i klase
  730.             $(this).removeAttr('style').removeClass().addClass('table table-bordered table-striped table-hover');
  731.             $(this).find('thead').removeAttr('style').removeClass();
  732.             $(this).find('tbody tr').removeAttr('style').removeClass();
  733.             $(this).find('th').removeAttr('style').removeClass();
  734.             $(this).find('td').removeAttr('style').removeClass();
  735.             // Smanjite margine i padding koristeći jQuery
  736.             $(this).css({
  737.                 'margin-bottom': '1rem',  // Smanjenje margine između tabela
  738.             });
  739.             // Postavite konkretne stilove za th i td elemente
  740.             $(this).find('th').css({
  741.                 'border': '1px solid #border-color',  // Postavite border-color
  742.                 'background-color': '#light-blue',    // Postavite light-blue
  743.                 'font-weight': '500',
  744.                 'padding': '0.5rem !important',
  745.                 'white-space': 'pre'
  746.             });
  747.             $(this).find('td').css({
  748.                 'border': '1px solid #border-color',  // Postavite border-color
  749.                 'text-align': 'left',
  750.                 'padding': '0.5rem !important',
  751.                 'white-space': 'pre'
  752.             });
  753.             // Isključite specifične stilove iz svih th i td elemenata
  754.             $(this).find('th, td').each(function() {
  755.                 var currentStyles = $(this).attr('style') || '';
  756.                 var newStyles = currentStyles
  757.                     .replace(/white-space:\s*nowrap;?\s*/gi, '')  // Uklanja white-space: nowrap;
  758.                     .replace(/text-align:\s*center;?\s*/gi, '');  // Uklanja text-align: center;
  759.                 $(this).attr('style', newStyles.trim());  // Postavlja ažurirane stilove
  760.             });
  761.             console.log('Specific styles applied and previous styles removed.');
  762.         });
  763.     });
  764.     $(function () {
  765.         $('[data-toggle="tooltip"]').tooltip()
  766.     })
  767.     $(document).ready(function() {
  768.         function updateNavbarSearchbar() {
  769.             // Provera da li <header> ima klasu 'nav-down' ili 'nav-up'
  770.             if ($('header').hasClass('nav-down') || $('header').hasClass('nav-up')) {
  771.                 // Ukloni inline stil ako postoji
  772.                 $('.main-header.navbar-searchbar').removeAttr('style');
  773.             } else {
  774.                 // Postavi inline stilove ako klase 'nav-down' ili 'nav-up' ne postoje
  775.                 $('.main-header.navbar-searchbar').css({
  776.                     'position': 'relative',
  777.                     // 'top': '-100px', // Zavisno od toga da li ti ovo treba ili ne
  778.                     'left': '0',
  779.                     'width': '100%',
  780.                     'margin-top': '0',
  781.                     'background-color': 'white', // Zamena za $white
  782.                     'box-shadow': '0px 4px 10px rgba(23, 32, 90, 0.15)',
  783.                     'transition': 'all 0.5s ease',
  784.                     'z-index': '6'
  785.                 });
  786.             }
  787.         }
  788.         // Poziv funkcije prilikom učitavanja stranice
  789.         updateNavbarSearchbar();
  790.         // Ako se menja klasa na headeru, pozovi ponovo
  791.         $(window).on('scroll', function() {
  792.             updateNavbarSearchbar();
  793.         });
  794.         $('#add-to-cart-form').on('submit', function(event) {
  795.             event.preventDefault();
  796.             $.ajax({
  797.                 url: '{{ path("app_cart_add") }}',
  798.                 type: 'POST',
  799.                 data: $(this).serialize(),
  800.                 success: function(response) {
  801.                     if (response.status === 'success') {
  802.                         // Update the cart item count in the header
  803.                         $('#korpa').text(response.totalItems);
  804.                         // Show success toast
  805.                         $.notify({
  806.                             message: response.message
  807.                         },{
  808.                             type: 'success',
  809.                             delay: 2000
  810.                         });
  811.                     } else {
  812.                         // Show error toast
  813.                         $.notify({
  814.                             message: response.message
  815.                         },{
  816.                             type: 'danger',
  817.                             delay: 2000
  818.                         });
  819.                     }
  820.                 }
  821.             });
  822.         });
  823.         $('#wishList').on('click', function(e) {
  824.             e.preventDefault(); // Sprečava standardno ponašanje linka
  825.             var productId = $(this).data('product-id');
  826.             $.ajax({
  827.                 url: '{{ path("app_favorite_add") }}', // Symfony ruta za dodavanje omiljenog
  828.                 type: 'GET', // Metod zahteva, može biti i 'GET' ako je vaša ruta tako definisana
  829.                 data: { product_id: productId }, // Podaci koji se šalju
  830.                 success: function(response) {
  831.                     if (response.status === 'success') {
  832.                         // Update the cart item count in the header
  833.                         $('#listaZelja').text(response.totalFavorites);
  834.                         // Show success toast
  835.                         $.notify({
  836.                             message: response.message
  837.                         },{
  838.                             type: 'success',
  839.                             delay: 2000
  840.                         });
  841.                     } else {
  842.                         // Show error toast
  843.                         $.notify({
  844.                             message: response.message
  845.                         },{
  846.                             type: 'danger',
  847.                             delay: 2000
  848.                         });
  849.                     }
  850.                 }
  851.             });
  852.         });
  853.         $('#commentForm').submit(function(event) {
  854.             event.preventDefault();
  855.             $.ajax({
  856.                 url: '{{ path('app_comment_add', {id: product.id}) }}',
  857.                 method: 'POST',
  858.                 data: $(this).serialize(),
  859.                 success: function(response) {
  860.                     if (response.status === 'success') {
  861.                         $.notify({ message: response.message }, { type: 'success' });
  862.                     } else {
  863.                         $.notify({ message: response.message }, { type: 'danger' });
  864.                     }
  865.                 },
  866.                 error: function() {
  867.                     $.notify({ message: 'Došlo je do greške. Pokušajte ponovo.' }, { type: 'danger' });
  868.                 }
  869.             });
  870.         });
  871.     });
  872.     {% block footerjavascript %}
  873.     $(document).ready(function() {
  874.         $('.addtoKorpa-btn').on('click', function() {
  875.             // Prikupljanje ID-a proizvoda iz data atributa dugmeta
  876.             var productId = $(this).data('product-id');
  877.             // Pronalazak odgovarajuće forme i slanje forme preko AJAX-a
  878.             var $form = $('#add-to-cart-form-' + productId);
  879.             $.ajax({
  880.                 url: $form.attr('action'),
  881.                 type: 'POST',
  882.                 data: $form.serialize(),
  883.                 success: function(response) {
  884.                     if (response.status === 'success') {
  885.                         // Ažuriranje broja proizvoda u korpi u zaglavlju
  886.                         $('#korpa').text(response.totalItems);
  887.                         // Prikazivanje uspešne poruke
  888.                         $.notify({
  889.                             message: response.message
  890.                         },{
  891.                             type: 'success',
  892.                             delay: 2000
  893.                         });
  894.                     } else {
  895.                         // Prikazivanje poruke o grešci
  896.                         $.notify({
  897.                             message: response.message
  898.                         },{
  899.                             type: 'danger',
  900.                             delay: 2000
  901.                         });
  902.                     }
  903.                 }
  904.             });
  905.             return false; // Sprečavanje default submitovanja forme
  906.         });
  907.         $('.addtoKorpaModal-btn').on('click', function() {
  908.             // Pronalazak najbliže forme roditelja dugmeta
  909.             var $form = $(this).closest('form');
  910.             $.ajax({
  911.                 url: $form.attr('action'),
  912.                 type: 'POST',
  913.                 data: $form.serialize(),
  914.                 success: function(response) {
  915.                     if (response.status === 'success') {
  916.                         // Ažuriranje broja proizvoda u korpi u zaglavlju
  917.                         $('#korpa').text(response.totalItems);
  918.                         // Prikazivanje uspešne poruke
  919.                         $.notify({
  920.                             message: response.message
  921.                         },{
  922.                             type: 'success',
  923.                             delay: 2000
  924.                         });
  925.                     } else {
  926.                         // Prikazivanje poruke o grešci
  927.                         $.notify({
  928.                             message: response.message
  929.                         },{
  930.                             type: 'danger',
  931.                             delay: 2000
  932.                         });
  933.                     }
  934.                 }
  935.             });
  936.             return false; // Sprečavanje default submitovanja forme
  937.         });
  938.         $('.search-type').on('input', function() {
  939.             var query = $(this).val();
  940.             if (query.length >= 3) {
  941.                 $.ajax({
  942.                     url: "{{ path('app_ajax_search') }}",
  943.                     type: "GET",
  944.                     dataType: 'json',
  945.                     data: {
  946.                         q: query
  947.                     },
  948.                     success: function(data) {
  949.                         var resultsContainer = $('#search-results');
  950.                         resultsContainer.empty();
  951.                         if (data.results.length > 0) {
  952.                             $.each(data.results, function(index, product) {
  953.                                 var productHtml = '<li>' +
  954.                                     '<div class="product-cart media">' +
  955.                                     '<img src="' + product.slika + '" class="img-fluid blur-up lazyload" alt="">' +
  956.                                     '<div class="media-body">' +
  957.                                     '<a href="' + product.link + '">' +
  958.                                     '<h6 class="mb-1">' + product.text + '</h6>' +
  959.                                     '</a>' +
  960.                                     '<p class="mb-0 mt-1">' + product.pricePDV + ' RSD</p>' +
  961.                                     '</div>' +
  962.                                     '</div>' +
  963.                                     '</li><br>';
  964.                                 // var productHtml = '<div><a href="' + product.link + '" class="man-section"><div class="image-section"><img src=' +
  965.                                 //     product.slika +
  966.                                 //     '></div><div class="description-section"><h6>' +
  967.                                 //     product.text +
  968.                                 //     "</h6><span>" +
  969.                                 //     product.pricePDV +
  970.                                 //     "</span></div></a>";
  971.                                 resultsContainer.append(productHtml);
  972.                             });
  973.                         } else {
  974.                             resultsContainer.append('<div class="empty-message">',
  975.                                 "Nije pronađen nijedan proizvod !",
  976.                                 "</div>");
  977.                         }
  978.                     },
  979.                     error: function() {
  980.                         console.log('Error loading search results.');
  981.                     }
  982.                 });
  983.             }
  984.         });
  985.         $('.close-search').on('click', function() {
  986.             $('.search-type').val('');
  987.             $('#search-results').empty();
  988.         });
  989.         function updateCartCount() {
  990.             $.ajax({
  991.                 url: '{{ path('app_cart_count') }}',
  992.                 method: 'GET',
  993.                 success: function(response) {
  994.                     $('#korpa').text(response.totalItems);
  995.                 },
  996.                 error: function() {
  997.                     console.error('Failed to fetch cart count.');
  998.                 }
  999.             });
  1000.         }
  1001.         updateCartCount();
  1002.         {% if app.user %}
  1003.         $('[id^=zelja_]').on('click', function(e) {
  1004.             e.preventDefault(); // Sprečava standardno ponašanje linka ili dugmeta
  1005.             var productId = $(this).data('product-id');
  1006.             $.ajax({
  1007.                 url: '{{ path("app_favorite_add") }}', // Symfony ruta za dodavanje omiljenog
  1008.                 type: 'GET', // Metod zahteva, može biti i 'GET' ako je vaša ruta tako definisana
  1009.                 data: { product_id: productId }, // Podaci koji se šalju
  1010.                 success: function(response) {
  1011.                     if (response.status === 'success') {
  1012.                         // Update the cart item count in the header
  1013.                         $('#listaZelja').text(response.totalFavorites);
  1014.                         // Show success toast
  1015.                         $.notify({
  1016.                             message: response.message
  1017.                         },{
  1018.                             type: 'success',
  1019.                             delay: 2000
  1020.                         });
  1021.                     } else {
  1022.                         // Show error toast
  1023.                         $.notify({
  1024.                             message: response.message
  1025.                         },{
  1026.                             type: 'danger',
  1027.                             delay: 2000
  1028.                         });
  1029.                     }
  1030.                 }
  1031.             });
  1032.         });
  1033.         function updateFavoriteCount() {
  1034.             $.ajax({
  1035.                 url: '{{ path('app_favorite_count') }}',
  1036.                 method: 'GET',
  1037.                 success: function(response) {
  1038.                     $('#listaZelja').text(response.totalFavorites);
  1039.                 },
  1040.                 error: function() {
  1041.                     console.error('Failed to fetch cart count.');
  1042.                 }
  1043.             });
  1044.         }
  1045.         updateFavoriteCount();
  1046.         {% endif %}
  1047.         $('li.sort_dropdown a').addClass('dropdown-item');
  1048.     });
  1049.     function printPage() {
  1050.         window.print();
  1051.     }
  1052.     {% endblock footerjavascript %}
  1053. </script>
  1054. <script>
  1055.     document.addEventListener('DOMContentLoaded', function() {
  1056.         // Select all <li> elements with class 'submenu-title'
  1057.         var submenuTitles = document.querySelectorAll('li.submenu-title');
  1058.         // Iterate over each <li> element
  1059.         submenuTitles.forEach(function(submenuTitle) {
  1060.             // Find all <span> elements with class 'according-menu' within the current <li>
  1061.             var spans = submenuTitle.querySelectorAll('span.according-menu');
  1062.             // Remove each <span> element with class 'according-menu'
  1063.             spans.forEach(function(span) {
  1064.                 span.remove();
  1065.             });
  1066.         });
  1067.     });
  1068. </script>
  1069. </body>
  1070. </html>