templates/Product/ProductCategory.html.twig line 1

Open in your IDE?
  1. {% extends "layout/layout.html.twig" %}
  2. {% block content %}
  3. {% set locale = app.request.locale %}
  4. {% if locale == 'en_GB' %}
  5.     {% set locale = 'en' %}
  6. {% endif %}
  7. {% if category != null %}
  8.     {% if category[0].video %}
  9.         {% set Video = category[0].video.data %}
  10.         {% set value = true %}
  11.     {% endif %}
  12. {% else %}
  13.     {% set value = false %}
  14. {% endif %}
  15.     <!--Start Banner Video-->
  16.       <span class = "pagetype d-none" >Product Listing Page</span>
  17.      <div class="banner-recipe">
  18.     <!-- <video id="home-video" class="video-js" controls autoplay loop preload="auto" poster="<= $category[0]->getVideo_Thumbnail() ?>"
  19.             data-setup="{}" height="400">
  20.             <source src="<= $value == true ? $video->getPath().$video->getFilename() : ''?>" type="video/mp4">
  21.        
  22.         </video> -->
  23.         <div class="rec-hm-cont">
  24.           <h1 class ="gtm-contentval">{{category[0].name }} {{"Products"|trans }}</h1>
  25.         
  26.         </div>
  27.       <img  src="{{category[0].video_Thumbnail}}" alt="">
  28.      
  29.     </div>
  30.     <!--End Banner Video-->
  31.     <!--Start Breadcrumbs-->
  32.     <nav aria-label="breadcrumb" class="breadcrumb-holder">
  33.       <div class="container-xl custom-container-xl">
  34.         <ol class="breadcrumb">
  35.           <li class="breadcrumb-item"><a href="/{{ locale }}">{{"Home"|trans }}</a></li>
  36.           <li class="breadcrumb-item"><a href="/{{ locale }}/{{"products"|trans }}">{{"Products"|trans }}</a></li>
  37.           <li class="breadcrumb-item active" aria-current="page">{{category[0].name}}
  38.           {# <!-- <a href="/<?php echo $weblink?>/productlist/<= $category[0]->getId();?>" class="breadcm-product-list"><= $category[0]->getName(); ?></a> --> #}
  39.           </li>
  40.         </ol>
  41.       </div>
  42.     </nav>
  43.     <!--End Breadcrumbs-->
  44.       <!--Start Products Holder Holder-->
  45.     <section class="products-holder products-detail-holder-edited">
  46.       <div class="container-xl custom-container-xl">
  47.           <!--Start Product Banner-->
  48.         <section class="products-banner">
  49.           <div class="row">
  50.             <div class="col-xl-6 products-banner-info">
  51.               <h1 class="sub-xl-heading">{{category[0].name}}</h1>
  52.               <p>{{category[0].description}}</p>
  53.             </div>
  54.             <div class="col-xl-6 products-banner-img" data-aos="zoom-in-up">
  55.            
  56.             <img src="{{category[0].image}}" alt="">
  57.             
  58.             </div>
  59.           </div>
  60.         </section>
  61.         <!--End Product Banner-->
  62.         <!--Start Products Listing-->
  63.         <section class="products-listing-holder">
  64.           <!--Start Listing-->
  65.           <div class="products-listing product-list-box single-product-list">
  66.             <div class="row">
  67.             {% for categProducts in category[0].products %}
  68.                 {% set regions = categProducts.regions %}
  69.                 {% set show = false %}
  70.                 {% if regions %}
  71.                     {% for key , region in regions %}
  72.                         {% if region in  groupids %}
  73.                           {% set show = true %}
  74.                         {% endif %}
  75.                     {% endfor %}
  76.                 {% endif %}
  77.             {# <?php 
  78.             
  79.             $categProducts $category[0]->getProducts();
  80.             for($i=0$i<count($categProducts); $i++){ 
  81.               $regions $categProducts[$i]->getRegions();
  82.                 $show false;
  83.                 if ($regions) {
  84.                   foreach($regions as $key => $region) {
  85.                     if (array_search($region$groupids) !== false) {
  86.                       $show true;
  87.                     }
  88.                   }
  89.                 }
  90.                 if ($show):
  91.                   $categProdAttrs $categProducts[$i]->getAttributes();    
  92.               if($categProdAttrs){
  93.                 for($cpa 0$cpa count($categProdAttrs); $cpa++){
  94.               ?> #}
  95.               {% if show %}
  96.                 {% if categProducts.attributes %}
  97.                 {% for categProdAttrs in categProducts.attributes %}
  98.               <div class="col-12 col-md-4 col-xl-3">
  99.                 <div class="slide">
  100.                   <div class="slide-holder product-list-sty pl-box">
  101.                     <div class="slide-img {{ "img" ~ categProdAttrs.size }}" data-aos="zoom-in-up">
  102.                  
  103.                        {% if categProdAttrs %}
  104.                         <a href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><img class="img-fluid" 
  105.                         src="{{categProdAttrs.images[0].path ~ categProdAttrs.images[0].filename }}"
  106.                         xoriginal="{{categProdAttrs.images[0].path ~ categProdAttrs.images[0].filename }}" /></a>
  107.                        {% endif %}
  108.                        
  109.                       <!-- <img alt="" class="img-fluid" src="/static/assets/images/product-01.png" /> -->
  110.                     </div>
  111.                     
  112.                     <div class="slide-info">
  113.                    
  114.                     {% if categProducts.name == 'Rainbow Evaporated Milk Low Cholesterol' %}
  115.                     {# <?php $str explode(" "$categProducts[$i]->getName()); $last $str[count($str)-1]?> #}
  116.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><small>{{'Rainbow'}}</small></a>
  117.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><h5 class="text_three__line_elipsis">{{'Evaporated Milk'}}<strong>{{'Low Cholesterol'}}</strong></h5></a>
  118.                     {% elseif categProducts.name == 'Rainbow Sweetened Condensed Milk'  %}
  119.                           {# <?php $str explode(" "$categProducts[$i]->getName()); $last $str[count($str)-1]?> #}
  120.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><small>{{'Rainbow'}}</small></a>
  121.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><h5 class="text_three__line_elipsis">{{'Sweetened'}}<strong>{{'Condensed Milk'}}</strong></h5></a>
  122.                     {% else %}
  123.                         {# <?php $str explode(" ",$categProducts[$i]->getName()); $last $str[count($str)-1]?> #}
  124.                        {% if locale == 'ar' %}
  125.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><small>{{categProducts.name}}</small></a>
  126.                        {% else %}
  127.                         {% set str = categProducts.name|split(' ') %}
  128.                             {% set srt_middle_word = "" %}
  129.                             {% for a in 1..str|length -2 %}
  130.                              {% set srt_middle_word = srt_middle_word ~ ' ' ~ str[a] %}
  131.                             {% endfor %}
  132.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><small>{{str[0]}}</small></a>
  133.                         <a class="remove-anchor-style2" href="/{{ locale }}/{{"products"|trans }}/{{categProdAttrs.url}}"><h5 class="text_three__line_elipsis">{{srt_middle_word}}<strong>{{str|last}}</strong></h5></a>
  134.                        {% endif %}
  135.                     {% endif %}
  136.                     <span class="text-white">{{categProdAttrs.size}}</span>
  137.                     </div>
  138.                     {% set  regionslinks = categProdAttrs.buttonlinks %}
  139.                     {% set rlink = [] %}
  140.                         {% for key , link in regionslinks %}
  141.                             {% if link['country'].data == country %}
  142.                                 {% set rlink = link %}
  143.                             {% endif %}
  144.                         {% endfor %}
  145.                         {% if not rlink %}
  146.                             {% for key , link in regionslinks %}
  147.                                 {% if link['country'].data == 'AE' %}
  148.                                      {% set rlink = link %}
  149.                                 {% endif %}
  150.                             {% endfor %}
  151.                         {% endif %}
  152.                     
  153.                     {# <?php 
  154.                         $regionslinks $category[0]->getProducts()[$i]->getAttributes()[0]->getButtonlinks();
  155.                         $rlink = [];
  156.                         foreach ($regionslinks as $key => $link) {
  157.                             if ($link['country']->getData() == $country) {
  158.                             $rlink $link;
  159.                             }
  160.                         }
  161.                         if (!$rlink) {
  162.                             foreach ($regionslinks as $key => $link) {
  163.                             if ($link['country']->getData() == 'AE') {
  164.                                 $rlink $link;
  165.                             }
  166.                             }
  167.                         }
  168.                         // echo '<pre>';
  169.                         // print_r($rlink);
  170.                         // echo '</pre>';
  171.                         ?> #}
  172.                     <div class="btn-holder pl-btn">
  173.                       <a  class="btn btn-primary ico-btn productbuynow" 
  174.                 data-lulu="{{ (rlink['lulu']) ? rlink['lulu'].data : '' }}"  
  175.                 data-union="{{ (rlink['unioncool']) ? rlink['unioncool'].data : '' }}" 
  176.                 data-amazon="{{ (rlink['amazon']) ? rlink['amazon'].data : '' }}" 
  177.                 data-carrefour="{{ (rlink['carrefour']) ? rlink['carrefour'].data : '' }}"
  178.                   data-c4="{{ (rlink['c4']) ? rlink['c4'].data : '' }}" 
  179.                   data-noon="{{ (rlink['noon']) ? rlink['noon'].data : '' }}" 
  180.                   data-danube="{{ (rlink['danube']) ? rlink['danube'].data : '' }}" 
  181.                   data-tawseel="{{ (rlink['tawseel']) ? rlink['tawseel'].data : '' }}" 
  182.                   data-sultancenter="{{ (rlink['sultancenter']) ? rlink['sultancenter'].data : '' }}" data-aos="zoom-in-up">
  183.                         <i><img src="/static/assets/images/shopping-cart.svg" alt=""></i>
  184.                         <span>{{"BuyNow"|trans }}</span>
  185.                         <!-- <= $this->translate("BuyNow"); ?> -->
  186.                       </a>
  187.                     </div>
  188.                   </div>
  189.                 </div>
  190.               </div>
  191.               
  192.                 {% endfor %}
  193.                 {% endif %}
  194.               {% endif %}
  195.               {% endfor %}
  196.             </div>
  197.           </div>
  198.           <!--End Listing-->
  199.         </section>
  200.         <!--End Products Listing-->
  201.       </div>
  202.     </section>
  203.     <!--End Recipe Holder-->
  204.     {% if (locale =='ar') %}
  205.         {% set topMenu ="/en/products/" ~ category[0].url('en') %}
  206.       {% else %}
  207.         {% set topMenu ="/ar/منتجات/" ~ category[0].url('ar') %}
  208.     {% endif %}
  209. <script type="text/javascript">
  210.     var _TopMenuLink = "{{topMenu }}"
  211. </script>
  212. {% endblock %}