templates/eshopCategory.html.twig line 1

Open in your IDE?
  1. {% if simpleView == true %}
  2.     {% set wireFrameFile = 'eshopLayoutSimple.html.php' %}
  3. {% elseif wireFrame.wireFrameFile is defined %}
  4.     {% set wireFrameFile = wireFrame.wireFrameFile %}
  5. {% else %}
  6.     {% set wireFrameFile = 'eshopLayoutBasic.html.php' %}
  7. {% endif %}
  8. {% extends wireFrameFile %}
  9. {% block page_contents %}
  10. {#    {% if seoData is defined and seoData.seoTitle is defined %}#}
  11. {#        {% block title %}{{ seoData.seoTitle }}{% endblock %}#}
  12. {#    {% endif %}#}
  13. {#    {% if seoData is defined and seoData.seoDescription is defined %}#}
  14. {#        {% block description %}{{ seoData.seoDescription }}{% endblock %}#}
  15. {#    {% endif %}#}
  16.     {% if category.categoryDescription != '' %}
  17.         <div class="categoryDescription">{{ category.categoryDescription }}</div>
  18.     {% endif %}
  19.     {% if childNodes|length > 0 %}
  20.         <div class="subcategories">{{ 'eshop.subcategories'|trans }}:</div>
  21.     {% endif %}
  22.     {% for cat in childNodes %}
  23.         {% if cat.isActive %}
  24.             <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/category/{{ cat.categoryId }}" class="categoryBoxLink">
  25.             <div class="categoryBox2">
  26.             
  27.                 <div class="categoryBox">
  28.                     <div class="categoryTitle">{{ cat.categoryName }}</div>
  29.                     {% if cat.image1  != "" %}
  30.                         {% if 'http' in cat.image1 %}
  31.                             {% set imagePath = cat.image1 %}
  32.                             {% set imageThumbPath = cat.image1 %}
  33.                         {% else %}
  34.                             {% set imagePath = cat.image1 %}
  35.                             {% set imageThumbPath = 'users/' ~ user.userName ~ '/images/thumb_' ~ cat.image1 %}
  36.                         {% endif %}
  37.                         <!-- we display image thumb -->
  38.                         <div class="categoryThumb">
  39.                             
  40.                                 <img src="{{ asset(imageThumbPath) }}" alt="Category Image" border="0" class="categoryThumbImg">
  41.                             
  42.                         </div>
  43.                     {% endif %}
  44.                 </div>
  45.             
  46.             </div>
  47.             </a>
  48.         {% endif %}
  49.     {% endfor %}
  50.     {% set productTemplate = 'eshopProduct_' ~ productView ~ '.html.twig' %}
  51. <!-- navigator -->
  52. <div class="navigator">
  53.     <span class="navigatorPath">
  54.         <!-- category path -->
  55.         <span class="productPath">
  56.         {% set catCount = 0 %}
  57.         {% for cat in categoryPath %}
  58.             {% if catCount == 0 %}
  59.                 <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}" class="pathLinkHome">{{ 'eshop.home'|trans }}</a>
  60.             {% endif %}
  61.             {% set catCount = catCount + 1 %}
  62.             {% if catCount == categoryPath|length %}
  63.                 <span class="pathSeparator">|</span> <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/category/{{ cat.categoryId }}" class="pathLinkCurrent">{{ cat.categoryName }}</a>
  64.             {% else %}
  65.                 <span class="pathSeparator">|</span> <a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/category/{{ cat.categoryId }}" class="pathLink">{{ cat.categoryName }}</a>
  66.             {% endif %}
  67.         {% endfor %}
  68.         </span>
  69.     </span>
  70.     <span class="paginator">
  71.         {% if eshop.countPerPage is defined %}
  72.             {% set countPerPage = eshop.countPerPage %}
  73.         {% else %}
  74.             {% set countPerPage = 20 %}
  75.         {% endif %}
  76.         {% set pageCount = productCount / countPerPage %}
  77.         {% set pageTotal = pageCount|round(0, 'ceil') %}
  78.         {% if pageTotal == 0 %}
  79.             {% set pageTotal = pageTotal + 1 %}
  80.         {% endif %}
  81.         {% if app.request.get('page') is defined and app.request.get('page') %}
  82.             {% set currentPage = app.request.get('page') %}
  83.         {% else %}
  84.             {% set currentPage = 1 %}
  85.         {% endif %}
  86.       <span class="smallDescription">{{ 'system.pages'|trans }}: {{ currentPage }}/{{ pageTotal }}</span>
  87.         {% set scheme = app.request.scheme %}
  88.         {% set host = app.request.host %}
  89.         {% for i in 1..pageTotal %}
  90.             {% if currentPage == i %}
  91.                 {% set cssClass = 'pageLinkCurrent' %}
  92.             {% else %}
  93.                 {% set cssClass = 'pageLink' %}
  94.             {% endif %}
  95.             {% if currentPage + 5 <= i %}
  96.                 {% if currentPage + 5 == i %}
  97.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage+1) }}" class="{{ cssClass }}">&gt;</a>
  98.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage+0) }}" class="{{ cssClass }}">&gt;&gt;</a>
  99.                 {% endif %}
  100.             {% elseif (currentPage-5) >= i %}
  101.                 {% if currentPage - 5 == i %}
  102.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page=1" class="{{ cssClass }}">&lt;&lt;</a>
  103.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage-1) }}" class="{{ cssClass }}">&lt;</a>
  104.                 {% endif %}
  105.             {% else %}
  106.                 <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ i }}" class="{{ cssClass }}">{{ i }}</a>
  107.             {% endif %}
  108.         {% endfor %}
  109.     </span>
  110.     <div class="clearPaginator">
  111.     </div>
  112. </div>    
  113. <!-- product list -->
  114. <div class="productContainer">
  115.     <!-- sort container -->
  116.     <div class="sortContainer">
  117.         <span class="sortTitle">{{ 'eshop.sort'|trans }}</span>
  118.         <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?sort=priceASC" class="sortLink">{{ 'eshop.price_asc'|trans }}</a>
  119.         <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?sort=productASC" class="sortLink">{{ 'eshop.product_name'|trans }}</a>
  120.         <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?sort=default" class="sortLink">{{ 'eshop.default'|trans }}</a>
  121.     </div>
  122.     {% for product in productList %}
  123.         {% set productVAT = null %}
  124.         {% if product is defined and product.productVAT is defined and product.productVAT > 0 %}
  125.             {% set productVAT = product.productVAT %}
  126.         {% elseif eshop.preferredVAT is defined and eshop.preferredVAT > 0 %}
  127.             {% set productVAT = eshop.preferredVAT %}
  128.         {% endif %}
  129.         {% set displayPrice = null %}
  130.         {% set displayPriceVAT = null %}
  131.         {% set defaultDisplayPrice = null %}
  132.         {% set defaultDisplayPriceVAT = null %}
  133.         {% set stoneShopPrice = null %}
  134.         {% for price in productPriceList %}
  135.             {% if price.productId == product.productId %}
  136.                 {# we get price level according to logged contact-customer #}
  137.                 {% if app.session.get('contact') is defined 
  138.                     and app.session.get('contact').priceLevel is defined 
  139.                     and app.session.get('contact').priceLevel.priceLevelId is defined 
  140.                     and price is defined 
  141.                     and price.priceLevelId is defined 
  142.                     and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
  143.                     {# we get netto or brutto value according to e-shop configuration #}
  144.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  145.                         {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  146.                     {% else %}
  147.                         {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  148.                     {% endif %}
  149.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  150.                         {% set displayPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
  151.                         {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  152.                     {% else %}
  153.                         {% set displayPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
  154.                         {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  155.                     {% endif %}
  156.                 {% elseif price.priceLevelId == 1 %}
  157.                     {# we get netto or brutto value according to e-shop configuration #}
  158.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  159.                         {% set displayPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  160.                     {% else %}
  161.                         {% set displayPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  162.                     {% endif %}
  163.                     {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  164.                         {% set displayPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
  165.                         {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  166.                     {% else %}
  167.                         {% set displayPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
  168.                         {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  169.                     {% endif %}
  170.                 {% elseif price.priceLevelId > 1 %}
  171.                     {% for priceLevel in priceLevelList %}
  172.                         {% if price.priceLevelId == priceLevel.priceLevelId and priceLevel.priceLevelName == "stoneshop" %}
  173.                             {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  174.                                 {% set stoneShopPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  175.                             {% else %}
  176.                                 {% set stoneShopPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  177.                             {% endif %}
  178.                         {% endif %}
  179.                     {% endfor %}
  180.                 {% endif %}
  181.             {% endif %}
  182.         {% endfor %}
  183.         {% set displayPackPrice = null %}
  184.         {% set displayPackPriceVAT = null %}
  185.         {% set defaultDisplayPackPrice = null %}
  186.         {% set defaultDisplayPackPriceVAT = null %}
  187.         {% if isPackSaleModule %}
  188.             {% for price in productPackPriceList %}
  189.                 {% if price.productId == product.productId %}
  190.                     {% if app.session.get('contact') is defined and app.session.get('contact').priceLevel is defined and price.priceLevelId == app.session.get('contact').priceLevel.priceLevelId %}
  191.                         {# we get netto or brutto value according to e-shop configuration #}
  192.                         {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  193.                             {% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  194.                         {% else %}
  195.                             {% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  196.                         {% endif %}
  197.                         {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  198.                             {% set displayPackPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
  199.                             {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  200.                         {% else %}
  201.                             {% set displayPackPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
  202.                             {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  203.                         {% endif %}
  204.                     {% elseif price.priceLevelId == 1 %}
  205.                         {# we get default price level#}
  206.                         {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  207.                             {% set displayPackPrice = price.nettoValue|round(eshop.roundPrice, 'ceil') %}
  208.                         {% else %}
  209.                             {% set displayPackPrice = price.bruttoValue|round(eshop.roundPrice, 'ceil') %}
  210.                         {% endif %}
  211.                         {% if eshop.displayNettoPrices is defined and eshop.displayNettoPrices %}
  212.                             {% set displayPackPriceVAT = displayPrice + (displayPrice * (productVAT/100)) %}
  213.                             {% set displayPriceVATLabel = 'product.price_with_VAT'|trans %}
  214.                         {% else %}
  215.                             {% set displayPackPriceVAT = displayPrice - (displayPrice * (productVAT/100)) %}
  216.                             {% set displayPriceVATLabel = 'product.price_without_VAT'|trans %}
  217.                         {% endif %}
  218.                     {% endif %}
  219.                 {% endif %}
  220.             {% endfor %}
  221.         {% endif %}
  222.         <a name="product_{{ product.productId }}"></a>
  223.         <!-- product template -->
  224.         {{ include(productTemplate) }}
  225.     {% endfor %}
  226. </div>
  227. <!-- navigator -->
  228. <div class="navigator">
  229.     <span class="navigatorPath">
  230.     </span>
  231.     <span class="paginator">
  232.         {% set pageCount = productCount/countPerPage %}
  233.       <span class="smallDescription">pages {{ currentPage }}/{{ pageTotal }}</span>
  234.         {% set scheme = app.request.scheme %}
  235.         {% set host = app.request.host %}
  236.         {% for i in 1..pageTotal %}
  237.             {% if currentPage == i %}
  238.                 {% set cssClass = 'pageLinkCurrent' %}
  239.             {% else %}
  240.                 {% set cssClass = 'pageLink' %}
  241.             {% endif %}
  242.             {% if currentPage + 5 <= i %}
  243.                 {% if currentPage + 5 == i %}
  244.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage+1) }}" class="{{ cssClass }}">&gt;</a>
  245.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage+0) }}" class="{{ cssClass }}">&gt;&gt;</a>
  246.                 {% endif %}
  247.             {% elseif (currentPage-5) >= i %}
  248.                 {% if currentPage - 5 == i %}
  249.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page=1" class="{{ cssClass }}">&lt;&lt;</a>
  250.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (currentPage-1) }}" class="{{ cssClass }}">&lt;</a>
  251.                 {% endif %}
  252.             {% else %}
  253.                 <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ i }}" class="{{ cssClass }}">{{ i }}</a>
  254.             {% endif %}
  255.         {% endfor %}
  256.     </span>
  257.     <div class="clearPaginator">
  258.     </div>
  259. </div>
  260. {% endblock %}