Advertisement
MuhammadJMontaser

product

Jan 20th, 2023
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Smarty 48.10 KB | None | 0 0
  1. {% set stylePrefix = j3.document.isPopup('quickview') ? 'quickviewPageStyle' : 'productPageStyle' %}
  2. {% set optionPrice = j3.settings.get(stylePrefix ~ 'OptionPrice') %}
  3. {% set direction = j3.settings.get(stylePrefix ~ 'AdditionalImagesPosition') == 'left' or j3.settings.get(stylePrefix ~ 'AdditionalImagesPosition') == 'right' ? 'vertical' : 'horizontal' %}
  4. {% set carousel = direction == 'vertical' or j3.settings.get(stylePrefix ~ 'AdditionalImagesCarousel') %}
  5. {% set carouselOptions = {
  6.   slidesPerView: 'auto',
  7.   spaceBetween: j3.settings.get(stylePrefix ~ 'AdditionalImagesSpacing')|default(0),
  8.   direction: direction
  9. } %}
  10. {% set galleryOptions = {
  11.   thumbWidth: j3.settings.get('image_dimensions_popup_thumb.width'),
  12.   thumbConHeight: j3.settings.get('image_dimensions_popup_thumb.height'),
  13.   addClass: 'lg-product-images',
  14.   mode: j3.settings.get(stylePrefix ~ 'GalleryMode'),
  15.   download: j3.settings.get(stylePrefix ~ 'GalleryDownload'),
  16.   fullScreen: j3.settings.get(stylePrefix ~ 'GalleryFullScreen')
  17. } %}
  18. {% set quickviewExpand = not j3.settings.get('quickviewExpandButton') or (j3.settings.get('globalExpandCharactersLimit') > 0 and description and description|length <= j3.settings.get('globalExpandCharactersLimit')) ? 'no-expand': '' %}
  19. {% if j3.isDescriptionEmpty(description) %}
  20. {% set description = '' %}
  21. {% endif %}
  22. {{ header }}
  23. {% if not j3.document.isPopup() %}
  24. <ul class="breadcrumb">
  25.   {% for breadcrumb in breadcrumbs %}
  26.   <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
  27.   {% endfor %}
  28. </ul>
  29. {% if j3.settings.get('pageTitlePosition') == 'top' %}
  30.   <h1 class="title page-title"><span>{{ heading_title }}</span></h1>
  31. {% endif %}
  32. {{ j3.loadController('journal3/layout', 'top') }}
  33. <div id="product-product" class="container">
  34.   <div class="row">{{ column_left }}
  35.     <div id="content" class="{{ class }}">
  36.       {% endif %}
  37.       {{ content_top }}
  38.       {% if not j3.document.isPopup('options') %}
  39.         {% if j3.settings.get('pageTitlePosition') == 'default' or j3.document.isPopup('quickview') %}
  40.           <h1 class="title page-title">{{ heading_title }}</h1>
  41.         {% endif %}
  42.       {% endif %}
  43.       {% set classes = j3.classes({
  44.         'out-of-stock': product_quantity <= 0,
  45.         'has-countdown': date_end,
  46.         'has-zero-price': not product_price_value,
  47.         'has-extra-button': product_extra_buttons,
  48.       }) ~ ' ' ~ product_exclude_classes %}
  49.       <div class="product-info {{ classes }}">
  50.         {% if not j3.document.isPopup('options') %}
  51.         <div class="product-left">
  52.           <div class="product-image direction-{{ direction }} position-{{ j3.settings.get(stylePrefix ~ 'AdditionalImagesPosition') }}">
  53.             <div class="swiper main-image" data-options='{{ j3.carousel(j3.document.getJs(), stylePrefix ~ 'ImageCarouselStyle')|json_encode(constant('JSON_FORCE_OBJECT')) }}' {% if images|length > 1 and j3.settings.get(stylePrefix ~ 'AdditionalImagesStatus') and carousel and direction == 'vertical' %}style="width: calc(100% - {{ j3.settings.get('image_dimensions_additional.width') }}px)"{% endif %}>
  54.               <div class="swiper-container" {% if j3.isRTL() %}dir="rtl"{% endif %}>
  55.                 <div class="swiper-wrapper">
  56.                   {% set gallery = [] %}
  57.                   {% for image in images %}
  58.                     {% set gallery = gallery|merge([{src: image.popup, thumb: image.galleryThumb, subHtml: heading_title}]) %}
  59.                     <div class="swiper-slide" {% if not j3.document.isPopup() and j3.settings.get(stylePrefix ~ 'GalleryStatus') %} data-gallery=".lightgallery-product-images" data-index="{{ loop.index0 }}" {% endif %}>
  60.                       <img src="{{ image.image }}" {% if image.image2x %}srcset="{{ image.image }} 1x, {{ image.image2x }} 2x"{% endif %} data-largeimg="{{ image.popup }}" alt="{{ heading_title }}" title="{{ heading_title }}" width="{{ j3.settings.get('image_dimensions_thumb.width') }}" height="{{ j3.settings.get('image_dimensions_thumb.height') }}" {% if not loop.first %}loading="lazy"{% endif %}/>
  61.                     </div>
  62.                   {% endfor %}
  63.                 </div>
  64.               </div>
  65.               <div class="swiper-controls">
  66.                 <div class="swiper-buttons">
  67.                   <div class="swiper-button-prev"></div>
  68.                   <div class="swiper-button-next"></div>
  69.                 </div>
  70.                 <div class="swiper-pagination"></div>
  71.               </div>
  72.               {% if product_labels %}
  73.                 <div class="product-labels">
  74.                   {% for id, label in product_labels %}
  75.                     <span class="product-label product-label-{{ id }} product-label-{{ label.display }}"><b>{{ label.label }}</b></span>
  76.                   {% endfor %}
  77.                 </div>
  78.               {% endif %}
  79.             </div>
  80.             {% if images|length > 1 and j3.settings.get(stylePrefix ~ 'AdditionalImagesStatus') %}
  81.               {% if carousel %}
  82.                 <div class="swiper additional-images" data-options='{{ carouselOptions|json_encode(constant('JSON_FORCE_OBJECT')) }}' {% if direction == 'vertical' %}style="width: {{ j3.settings.get('image_dimensions_additional.width') }}px"{% endif %}>
  83.                   <div class="swiper-container" {% if j3.isRTL() %}dir="rtl"{% endif %}>
  84.                     <div class="swiper-wrapper">
  85.                       {% for image in images %}
  86.                         <div class="swiper-slide additional-image" data-index="{{ loop.index0 }}">
  87.                           <img src="{{ image.thumb }}" {% if image.thumb2x %}srcset="{{ image.thumb }} 1x, {{ image.thumb2x }} 2x"{% endif %} alt="{{ heading_title }}" title="{{ heading_title }}" width="{{ j3.settings.get('image_dimensions_additional.width') }}" height="{{ j3.settings.get('image_dimensions_additional.height') }}" {% if not loop.first %}loading="lazy"{% endif %}/>
  88.                         </div>
  89.                       {% endfor %}
  90.                     </div>
  91.                   </div>
  92.                   <div class="swiper-buttons">
  93.                     <div class="swiper-button-prev"></div>
  94.                     <div class="swiper-button-next"></div>
  95.                   </div>
  96.                   <div class="swiper-pagination"></div>
  97.                 </div>
  98.               {% else %}
  99.                 <div class="additional-images">
  100.                   {% for image in images %}
  101.                     <div class="additional-image" data-index="{{ loop.index0 }}">
  102.                       <img src="{{ image.thumb }}" alt="{{ heading_title }}" title="{{ heading_title }}" width="{{ j3.settings.get('image_dimensions_additional.width') }}" height="{{ j3.settings.get('image_dimensions_additional.height') }}"/>
  103.                     </div>
  104.                   {% endfor %}
  105.                 </div>
  106.               {% endif %}
  107.             {% endif %}
  108.           </div>
  109.           {% if not j3.document.isPopup() and j3.settings.get(stylePrefix ~ 'GalleryStatus') %}
  110.           <div class="lightgallery lightgallery-product-images" data-images='{{ gallery|json_encode|e }}' data-options='{{ galleryOptions|json_encode(constant('JSON_FORCE_OBJECT')) }}'></div>
  111.           {% endif %}
  112.           {% if not j3.document.isPopup('options') %}
  113.             {% if product_blocks.image %}
  114.             <div class="product-blocks blocks-image">
  115.               {{ product_blocks.image|join }}
  116.             </div>
  117.             {% endif %}
  118.           {% endif %}
  119.           {% if description and j3.document.isPopup('quickview') and j3.settings.get('quickviewDescription') and (j3.settings.get('quickviewDescriptionPosition') == 'image') %}
  120.             <div class="description {{ quickviewExpand }}">
  121.               <div class="expand-block">
  122.                 <div class="expand-content">
  123.                   {{ description }}
  124.                 </div>
  125.                 {% if j3.settings.get('quickviewExpandButton') %}
  126.                   <div class="block-expand-overlay"><a class="block-expand btn"></a></div>
  127.                 {% endif %}
  128.               </div>
  129.             </div>
  130.           {% endif %}
  131.           {% if tags and not j3.document.isPopup() and (j3.settings.get(stylePrefix ~ 'TagsPosition') == 'image') %}
  132.             <div class="tags">
  133.               <span class="tags-title">{{ text_tags }}</span>
  134.               {% for tag in tags %}
  135.                 <a href="{{ tag.href }}">{{ tag.tag }}</a>
  136.                 {% if not loop.last %}<b>,</b>{% endif %}
  137.               {% endfor %}
  138.             </div>
  139.           {% endif %}
  140.         </div>
  141.         {% endif %}
  142.         <div class="product-right">
  143.           <div id="product" class="product-details">
  144.           {% if not j3.document.isPopup('options') %}
  145.           <div class="title page-title">{{ heading_title }}</div>
  146.           {% if product_blocks.top %}
  147.           <div class="product-blocks blocks-top">
  148.           {{ product_blocks.top|join }}
  149.           </div>
  150.           {% endif %}
  151.           {% endif %}
  152.  
  153.           {% if description and j3.document.isPopup('quickview') and j3.settings.get('quickviewDescription') and (j3.settings.get('quickviewDescriptionPosition') == 'top') %}
  154.             <div class="description {{ quickviewExpand }}">
  155.               <div class="expand-block">
  156.                 <div class="expand-content">
  157.                   {{ description }}
  158.                 </div>
  159.                 {% if j3.settings.get('quickviewExpandButton') %}
  160.                   <div class="block-expand-overlay"><a class="block-expand btn"></a></div>
  161.                 {% endif %}
  162.               </div>
  163.             </div>
  164.           {% endif %}
  165.  
  166.           {% if not j3.document.isPopup('options') and j3.settings.get(stylePrefix ~ 'Stats') and (j3.settings.get(stylePrefix ~ 'StatsPosition') == 'default') %}
  167.             <div class="product-stats">
  168.               <ul class="list-unstyled">
  169.                 {% if j3.settings.get(stylePrefix ~ 'ProductStock')%}
  170.                   <li class="product-stock {% if product_quantity > 0 %}in-stock{% else %}out-of-stock{% endif %}"><b>{{ j3.settings.get(stylePrefix ~ 'ProductStockText') }}:</b> <span>{{ stock }}</span></li>
  171.                 {% endif %}
  172.                 {% if manufacturer and j3.settings.get(stylePrefix ~ 'ProductManufacturer') and (j3.settings.get(stylePrefix ~ 'ProductManufacturerDisplay') == 'list') %}
  173.                   <li class="product-manufacturer"><b>{{ j3.settings.get(stylePrefix ~ 'ProductManufacturerText') }}:</b> <a href="{{ manufacturers }}">{{ manufacturer }}</a></li>
  174.                 {% endif %}
  175.                 {% if j3.settings.get(stylePrefix ~ 'ProductReward') and reward %}
  176.                   <li class="product-reward"><b>{{ j3.settings.get(stylePrefix ~ 'ProductRewardText') }}:</b> <span>{{ reward }}</span></li>
  177.                 {% endif %}
  178.                 {% if j3.settings.get(stylePrefix ~ 'ProductModel') and model %}
  179.                   <li class="product-model"><b>{{ j3.settings.get(stylePrefix ~ 'ProductModelText') }}:</b> <span>{{ model }}</span></li>
  180.                 {% endif %}
  181.                 {% if j3.settings.get(stylePrefix ~ 'ProductWeight') and product_weight %}
  182.                   <li class="product-weight"><b>{{ j3.settings.get(stylePrefix ~ 'ProductWeightText') }}:</b> <span>{{ product_weight }}</span></li>
  183.                 {% endif %}
  184.                 {% if j3.settings.get(stylePrefix ~ 'ProductDimension') and product_dimension %}
  185.                   <li class="product-dimension"><b>{{ j3.settings.get(stylePrefix ~ 'ProductDimensionText') }}:</b> <span>{{ product_length }} x {{ product_width }} x {{ product_height }}</span></li>
  186.                 {% endif %}
  187.                 {% if j3.settings.get(stylePrefix ~ 'ProductSKU') and product_sku %}
  188.                   <li class="product-sku"><b>{{ j3.settings.get(stylePrefix ~ 'ProductSKUText') }}:</b> <span> {{ product_sku }}</span></li>
  189.                 {% endif %}
  190.                 {% if j3.settings.get(stylePrefix ~ 'ProductUPC') and product_upc %}
  191.                   <li class="product-upc"><b>{{ j3.settings.get(stylePrefix ~ 'ProductUPCText') }}:</b> <span>{{ product_upc }}</span></li>
  192.                 {% endif %}
  193.                 {% if j3.settings.get(stylePrefix ~ 'ProductEAN') and product_ean %}
  194.                   <li class="product-ean"><b>{{ j3.settings.get(stylePrefix ~ 'ProductEANText') }}:</b> <span>{{ product_ean }}</span></li>
  195.                 {% endif %}
  196.                 {% if j3.settings.get(stylePrefix ~ 'ProductJAN') and product_jan %}
  197.                   <li class="product-jan"><b>{{ j3.settings.get(stylePrefix ~ 'ProductJANText') }}:</b> <span>{{ product_jan }}</span></li>
  198.                 {% endif %}
  199.                 {% if j3.settings.get(stylePrefix ~ 'ProductISBN') and product_isbn %}
  200.                   <li class="product-isbn"><b>{{ j3.settings.get(stylePrefix ~ 'ProductISBNText') }}:</b> <span>{{ product_isbn }}</span></li>
  201.                 {% endif %}
  202.                 {% if j3.settings.get(stylePrefix ~ 'ProductMPN') and product_mpn %}
  203.                   <li class="product-mpn"><b>{{ j3.settings.get(stylePrefix ~ 'ProductMPNText') }}:</b> <span>{{ product_mpn }}</span></li>
  204.                 {% endif %}
  205.                 {% if j3.settings.get(stylePrefix ~ 'ProductLocation') and product_location %}
  206.                   <li class="product-location"><b>{{ j3.settings.get(stylePrefix ~ 'ProductLocationText') }}:</b> <span>{{ product_location }}</span></li>
  207.                 {% endif %}
  208.               </ul>
  209.               {% if manufacturer and j3.settings.get(stylePrefix ~ 'ProductManufacturer') and (j3.settings.get(stylePrefix ~ 'ProductManufacturerDisplay') == 'image') %}
  210.                 <div class="brand-image product-manufacturer">
  211.                   <a href="{{ manufacturers }}">
  212.                     {% if manufacturer_image %}
  213.                       <img src="{{ manufacturer_image }}" {% if manufacturer_image2x %}srcset="{{ manufacturer_image }} 1x, {{ manufacturer_image2x }} 2x"{% endif %} alt="{{ manufacturer }}" width="{{ j3.settings.get('image_dimensions_manufacturer_logo.width') }}" height="{{ j3.settings.get('image_dimensions_manufacturer_logo.height') }}"/>
  214.                     {% endif %}
  215.                     <span>{{ manufacturer }}</span>
  216.                   </a>
  217.                 </div>
  218.               {% endif %}
  219.               {% if j3.settings.get(stylePrefix ~ 'CustomStats')%}
  220.                 <div class="custom-stats">
  221.                   {% if j3.settings.get(stylePrefix ~ 'ProductSold')%}
  222.                     <div class="product-sold"><b>{{ j3.settings.getWithValue(stylePrefix ~ 'SoldText', products_sold) }}</b></div>
  223.                   {% endif %}
  224.                   {% if j3.settings.get(stylePrefix ~ 'ProductViews')%}
  225.                     <div class="product-views"><b>{{ j3.settings.getWithValue(stylePrefix ~ 'ViewsText', product_views) }}</b></div>
  226.                   {% endif %}
  227.                 </div>
  228.               {% endif %}
  229.             </div>
  230.           {% endif %}
  231.  
  232.           {% if review_status and not j3.document.isPopup() %}
  233.             <div class="rating rating-page">
  234.               <div class="rating-stars">
  235.                 {% for i in 1..5 %}
  236.                   {% if rating < i %}
  237.                     <span class="fa fa-stack">
  238.                       <i class="fa fa-star-o fa-stack-1x"></i>
  239.                     </span>{% else %}
  240.                     <span class="fa fa-stack">
  241.                       <i class="fa fa-star fa-stack-1x"></i>
  242.                       <i class="fa fa-star-o fa-stack-1x"></i>
  243.                     </span>
  244.                   {% endif %}
  245.                 {% endfor %}
  246.               </div>
  247.               <div class="review-links">
  248.                 <a>{{ reviews }}</a>
  249.                 <b>{{ j3.settings.get(stylePrefix ~ 'RatingSeparator') }}</b>
  250.                 <a>{{ text_write }}</a>
  251.               </div>
  252.             </div>
  253.           {% endif %}
  254.  
  255.           {% if date_end and j3.settings.get(j3.document.isPopup() ? 'quickviewCountdown' : 'countdownStatus') %}
  256.             <div class="countdown-wrapper">
  257.               {% if j3.settings.get(stylePrefix ~ 'CountdownText') %}
  258.               <h5 class="countdown-title title">{{ j3.settings.get(stylePrefix ~ 'CountdownText') }}</h5>
  259.               {% endif %}
  260.               <div class="countdown" data-date="{{ date_end }}">
  261.                 <div><i class="fa fa-spinner fa-spin"></i><span>{{ j3.settings.get('countdownDay') }}</span></div>
  262.                 <div><i class="fa fa-spinner fa-spin"></i><span>{{ j3.settings.get('countdownHour') }}</span></div>
  263.                 <div><i class="fa fa-spinner fa-spin"></i><span>{{ j3.settings.get('countdownMin') }}</span></div>
  264.                 <div><i class="fa fa-spinner fa-spin"></i><span>{{ j3.settings.get('countdownSec') }}</span></div>
  265.               </div>
  266.             </div>
  267.           {% endif %}
  268.  
  269.           {% if price and not j3.document.isPopup('options') %}
  270.           <div class="product-price-group">
  271.            <div class="price-wrapper">
  272.              <div class="price-group">
  273.                {% if not special %}
  274.                  <div class="product-price">{{ price }}</div>
  275.                {% else %}
  276.                  <div class="product-price-new">{{ special }}</div>
  277.                  <div class="product-price-old">{{ price }}</div>
  278.                {% endif %}
  279.              </div>
  280.              {% if tax %}
  281.                <div class="product-tax">{{ text_tax }} {{ tax }}</div>
  282.              {% endif %}
  283.              {% if points %}
  284.                <div class="product-points">{{ text_points }} {{ points }}</div>
  285.              {% endif %}
  286.  
  287.              {% if discounts %}
  288.                <div class="discounts">
  289.                  {% for discount in discounts %}
  290.                    <div class="product-discount">{{ discount.quantity }}{{ text_discount }}{{ discount.price }}</div>
  291.                  {% endfor %}
  292.                </div>
  293.              {% endif %}
  294.            </div>
  295.             {% if not j3.document.isPopup('options') and j3.settings.get(stylePrefix ~ 'Stats') and (j3.settings.get(stylePrefix ~ 'StatsPosition') == 'price') %}
  296.               <div class="product-stats">
  297.                 <ul class="list-unstyled">
  298.                   {% if j3.settings.get(stylePrefix ~ 'ProductStock')%}
  299.                     <li class="product-stock {% if product_quantity > 0 %}in-stock{% else %}out-of-stock{% endif %}"><b>{{ j3.settings.get(stylePrefix ~ 'ProductStockText') }}:</b> <span>{{ stock }}</span></li>
  300.                   {% endif %}
  301.                   {% if manufacturer and j3.settings.get(stylePrefix ~ 'ProductManufacturer') and (j3.settings.get(stylePrefix ~ 'ProductManufacturerDisplay') == 'list') %}
  302.                     <li class="product-manufacturer"><b>{{ j3.settings.get(stylePrefix ~ 'ProductManufacturerText') }}:</b> <a href="{{ manufacturers }}">{{ manufacturer }}</a></li>
  303.                   {% endif %}
  304.                   {% if j3.settings.get(stylePrefix ~ 'ProductReward') and reward %}
  305.                     <li class="product-reward"><b>{{ j3.settings.get(stylePrefix ~ 'ProductRewardText') }}:</b> <span>{{ reward }}</span></li>
  306.                   {% endif %}
  307.                   {% if j3.settings.get(stylePrefix ~ 'ProductModel') and model %}
  308.                     <li class="product-model"><b>{{ j3.settings.get(stylePrefix ~ 'ProductModelText') }}:</b> <span>{{ model }}</span></li>
  309.                   {% endif %}
  310.                   {% if j3.settings.get(stylePrefix ~ 'ProductWeight') and product_weight %}
  311.                     <li class="product-weight"><b>{{ j3.settings.get(stylePrefix ~ 'ProductWeightText') }}:</b> <span>{{ product_weight }}</span></li>
  312.                   {% endif %}
  313.                   {% if j3.settings.get(stylePrefix ~ 'ProductDimension') and product_dimension %}
  314.                     <li class="product-dimension"><b>{{ j3.settings.get(stylePrefix ~ 'ProductDimensionText') }}:</b> <span>{{ product_length }} x {{ product_width }} x {{ product_height }}</span></li>
  315.                   {% endif %}
  316.                   {% if j3.settings.get(stylePrefix ~ 'ProductSKU') and product_sku %}
  317.                     <li class="product-sku"><b>{{ j3.settings.get(stylePrefix ~ 'ProductSKUText') }}:</b> <span> {{ product_sku }}</span></li>
  318.                   {% endif %}
  319.                   {% if j3.settings.get(stylePrefix ~ 'ProductUPC') and product_upc %}
  320.                     <li class="product-upc"><b>{{ j3.settings.get(stylePrefix ~ 'ProductUPCText') }}:</b> <span>{{ product_upc }}</span></li>
  321.                   {% endif %}
  322.                   {% if j3.settings.get(stylePrefix ~ 'ProductEAN') and product_ean %}
  323.                     <li class="product-ean"><b>{{ j3.settings.get(stylePrefix ~ 'ProductEANText') }}:</b> <span>{{ product_ean }}</span></li>
  324.                   {% endif %}
  325.                   {% if j3.settings.get(stylePrefix ~ 'ProductJAN') and product_jan %}
  326.                     <li class="product-jan"><b>{{ j3.settings.get(stylePrefix ~ 'ProductJANText') }}:</b> <span>{{ product_jan }}</span></li>
  327.                   {% endif %}
  328.                   {% if j3.settings.get(stylePrefix ~ 'ProductISBN') and product_isbn %}
  329.                     <li class="product-isbn"><b>{{ j3.settings.get(stylePrefix ~ 'ProductISBNText') }}:</b> <span>{{ product_isbn }}</span></li>
  330.                   {% endif %}
  331.                   {% if j3.settings.get(stylePrefix ~ 'ProductMPN') and product_mpn %}
  332.                     <li class="product-mpn"><b>{{ j3.settings.get(stylePrefix ~ 'ProductMPNText') }}:</b> <span>{{ product_mpn }}</span></li>
  333.                   {% endif %}
  334.                   {% if j3.settings.get(stylePrefix ~ 'ProductLocation') and product_location %}
  335.                     <li class="product-location"><b>{{ j3.settings.get(stylePrefix ~ 'ProductLocationText') }}:</b> <span>{{ product_location }}</span></li>
  336.                   {% endif %}
  337.                 </ul>
  338.                 {% if manufacturer and j3.settings.get(stylePrefix ~ 'ProductManufacturer') and (j3.settings.get(stylePrefix ~ 'ProductManufacturerDisplay') == 'image') %}
  339.                   <div class="brand-image product-manufacturer">
  340.                     <a href="{{ manufacturers }}">
  341.                       {% if manufacturer_image %}
  342.                         <img src="{{ manufacturer_image }}" {% if manufacturer_image2x %}srcset="{{ manufacturer_image }} 1x, {{ manufacturer_image2x }} 2x"{% endif %} alt="{{ manufacturer }}" width="{{ j3.settings.get('image_dimensions_manufacturer_logo.width') }}" height="{{ j3.settings.get('image_dimensions_manufacturer_logo.height') }}"/>
  343.                       {% endif %}
  344.                       <span>{{ manufacturer }}</span>
  345.                     </a>
  346.                   </div>
  347.                 {% endif %}
  348.                 {% if j3.settings.get(stylePrefix ~ 'CustomStats')%}
  349.                   <div class="custom-stats">
  350.                     {% if j3.settings.get(stylePrefix ~ 'ProductSold')%}
  351.                       <div class="product-sold"><b>{{ j3.settings.getWithValue(stylePrefix ~ 'SoldText', products_sold) }}</b></div>
  352.                     {% endif %}
  353.                     {% if j3.settings.get(stylePrefix ~ 'ProductViews')%}
  354.                       <div class="product-views"><b>{{ j3.settings.getWithValue(stylePrefix ~ 'ViewsText', product_views) }}</b></div>
  355.                     {% endif %}
  356.                   </div>
  357.                 {% endif %}
  358.               </div>
  359.             {% endif %}
  360.           </div>
  361.           {% endif %}
  362.  
  363.           {% if options %}
  364.           <div class="product-options">
  365.             <h3 class="options-title title">{{ text_option }}</h3>
  366.             {% for option in options %}
  367.             {% if option.type == 'select' %}
  368.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ 'OptionsPushSelect') %}push-option{% endif %}">
  369.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  370.               <select name="option[{{ option.product_option_id }}]" id="input-option{{ option.product_option_id }}" class="form-control">
  371.                 <option value="">{{ text_select }}</option>
  372.                 {% for option_value in option.product_option_value %}
  373.                 <option value="{{ option_value.product_option_value_id }}">{{ option_value.name }}
  374.                 {% if option_value.price and optionPrice %}
  375.                 ({{ option_value.price_prefix }}{{ option_value.price }})
  376.                 {% endif %} </option>
  377.                 {% endfor %}
  378.               </select>
  379.             </div>
  380.             {% endif %}
  381.             {% if option.type == 'radio' %}
  382.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ 'OptionsPushRadio') %}push-option{% endif %}">
  383.               <label class="control-label">{{ option.name }}</label>
  384.               <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
  385.                 <div class="radio">
  386.                   <label>
  387.                     <input type="radio" name="option[{{ option.product_option_id }}]" value="{{ option_value.product_option_value_id }}" />
  388.                     {% if option_value.image %} <img width="{{ j3.settings.get('image_dimensions_options.width') }}" height="{{ j3.settings.get('image_dimensions_options.height') }}" src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price and optionPrice %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" data-toggle="tooltip" data-tooltip-class="push-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'PushTooltipPosition') }}" title="{{ option_value.name }} {% if option_value.price and optionPrice %} ({{ option_value.price_prefix }}{{ option_value.price }}) {% endif %}"/> {% endif %}
  389.                     <span class="option-value">
  390.                       {{ option_value.name }}
  391.                       {% if option_value.price and optionPrice %}
  392.                         <span class="option-price">
  393.                           ({{ option_value.price_prefix }}{{ option_value.price }})
  394.                         </span>
  395.                       {% endif %}
  396.                     </span>
  397.                   </label>
  398.                 </div>
  399.                 {% endfor %} </div>
  400.             </div>
  401.             {% endif %}
  402.             {% if option.type == 'checkbox' %}
  403.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }} {% if j3.settings.get(stylePrefix ~ 'OptionsPushCheckbox') %}push-option{% endif %}">
  404.               <label class="control-label">{{ option.name }}</label>
  405.               <div id="input-option{{ option.product_option_id }}"> {% for option_value in option.product_option_value %}
  406.                 <div class="checkbox">
  407.                   <label>
  408.                     <input type="checkbox" name="option[{{ option.product_option_id }}][]" value="{{ option_value.product_option_value_id }}" />
  409.                     {% if option_value.image %} <img width="{{ j3.settings.get('image_dimensions_options.width') }}" height="{{ j3.settings.get('image_dimensions_options.height') }}" src="{{ option_value.image }}" alt="{{ option_value.name }} {% if option_value.price and optionPrice %} {{ option_value.price_prefix }} {{ option_value.price }} {% endif %}" data-toggle="tooltip" data-tooltip-class="push-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'PushTooltipPosition') }}" title="{{ option_value.name }} {% if option_value.price and optionPrice %} ({{ option_value.price_prefix }}{{ option_value.price }}) {% endif %}"/> {% endif %}
  410.                     <span class="option-value">
  411.                       {{ option_value.name }}
  412.                       {% if option_value.price and optionPrice %}
  413.                         <span class="option-price">({{ option_value.price_prefix }}{{ option_value.price }})</span>
  414.                       {% endif %}
  415.                     </span>
  416.                   </label>
  417.                 </div>
  418.                 {% endfor %} </div>
  419.             </div>
  420.             {% endif %}
  421.             {% if option.type == 'text' %}
  422.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  423.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  424.               <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control" />
  425.             </div>
  426.             {% endif %}
  427.             {% if option.type == 'textarea' %}
  428.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  429.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  430.               <textarea name="option[{{ option.product_option_id }}]" rows="5" placeholder="{{ option.name }}" id="input-option{{ option.product_option_id }}" class="form-control">{{ option.value }}</textarea>
  431.             </div>
  432.             {% endif %}
  433.             {% if option.type == 'file' %}
  434.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  435.               <label class="control-label">{{ option.name }}</label>
  436.               <button type="button" id="button-upload{{ option.product_option_id }}" data-loading-text="{{ text_loading }}" class="btn btn-default btn-block"><i class="fa fa-upload"></i> {{ button_upload }}</button>
  437.               <input type="hidden" name="option[{{ option.product_option_id }}]" value="" id="input-option{{ option.product_option_id }}" />
  438.             </div>
  439.             {% endif %}
  440.             {% if option.type == 'date' %}
  441.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  442.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  443.               <div class="input-group date" data-picker-class="product-options pp-date-time-picker">
  444.                 <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD" id="input-option{{ option.product_option_id }}" class="form-control" />
  445.                 <span class="input-group-btn">
  446.                 <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  447.                 </span></div>
  448.             </div>
  449.             {% endif %}
  450.             {% if option.type == 'datetime' %}
  451.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  452.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  453.               <div class="input-group datetime" data-picker-class="product-options pp-date-time-picker">
  454.                 <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="YYYY-MM-DD HH:mm" id="input-option{{ option.product_option_id }}" class="form-control" />
  455.                 <span class="input-group-btn">
  456.                 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  457.                 </span></div>
  458.             </div>
  459.             {% endif %}
  460.             {% if option.type == 'time' %}
  461.             <div class="form-group{% if option.required %} required {% endif %} product-option-{{ option.type }}">
  462.               <label class="control-label" for="input-option{{ option.product_option_id }}">{{ option.name }}</label>
  463.               <div class="input-group time" data-picker-class="product-options pp-date-time-picker">
  464.                 <input type="text" name="option[{{ option.product_option_id }}]" value="{{ option.value }}" data-date-format="HH:mm" id="input-option{{ option.product_option_id }}" class="form-control" />
  465.                 <span class="input-group-btn">
  466.                 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  467.                 </span></div>
  468.             </div>
  469.             {% endif %}
  470.             {% endfor %}
  471.           </div>
  472.           {% endif %}
  473.  
  474.           {% if recurrings %}
  475.             <h3 class="title recurring-title">{{ text_payment_recurring }}</h3>
  476.             <div class="form-group required">
  477.               <select name="recurring_id" class="form-control">
  478.                 <option value="">{{ text_select }}</option>
  479.                 {% for recurring in recurrings %}
  480.                 <option value="{{ recurring.recurring_id }}">{{ recurring.name }}</option>
  481.                 {% endfor %}
  482.               </select>
  483.               <div class="help-block" id="recurring-description"></div>
  484.             </div>
  485.           {% endif %}
  486.  
  487.           {% if j3.settings.get('catalogCartStatus') or j3.settings.get('catalogWishlistStatus') or j3.settings.get('catalogCompareStatus') or (product_extra_buttons and not j3.document.isPopup()) %}
  488.           <div class="button-group-page">
  489.             <div class="buttons-wrapper">
  490.               <div class="stepper-group cart-group">
  491.                 {% if j3.settings.get('catalogCartStatus') %}
  492.                 <div class="stepper">
  493.                   <label class="control-label" for="product-quantity">{{ entry_qty }}</label>
  494.                   <input id="product-quantity" type="text" name="quantity" value="{{ journal3_product_quantity > 0 ? journal3_product_quantity : minimum }}" data-minimum="{{ minimum }}" class="form-control"/>
  495.                   <input id="product-id" type="hidden" name="product_id" value="{{ product_id }}" />
  496.                   <span>
  497.                   <i class="fa fa-angle-up"></i>
  498.                   <i class="fa fa-angle-down"></i>
  499.                 </span>
  500.                 </div>
  501.                 <a id="button-cart" data-loading-text="<span class='btn-text'>{{ button_cart }}</span>" class="btn btn-cart" {% if (j3.settings.get(stylePrefix ~ 'CartDisplay') == "icon") and (j3.settings.get(stylePrefix ~ 'CartTooltipStatus')) %} data-toggle="tooltip" data-tooltip-class="pp-cart-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'CartTooltipPosition') }}" title="{{ button_cart }}" {% endif %}><span class="btn-text">{{ button_cart }}</span></a>
  502.                 {% endif %}
  503.                 {% if product_extra_buttons and not j3.document.isPopup() %}
  504.                   <div class="extra-group">
  505.                     {% for id, extra_button in product_extra_buttons %}
  506.                       <a class="btn btn-extra btn-extra-{{ id }} btn-{{ loop.index }}-extra" {% if (j3.settings.get(stylePrefix ~ 'Extra' ~ loop.index ~ 'ButtonDisplay') == "icon") and (j3.settings.get(stylePrefix ~ 'ExtraTooltipStatus')) %} data-toggle="tooltip" data-tooltip-class="extra-tooltip pp-extra-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'ExtraTooltipPosition') }}" title="{{ extra_button.label }}" {% endif %} {% if extra_button.action == 'quickbuy' %}data-quick-buy{% endif %} {% if extra_button.action == 'link' and extra_button.link.href %}href="{{ extra_button.link.href }}" {{ j3.linkAttrs(extra_button.link) }} data-product_id="{{ product_id }}"{% endif %} data-loading-text="<span class='btn-text'>{{ extra_button.label }}</span>"><span class="btn-text">{{ extra_button.label }}</span></a>
  507.                     {% endfor %}
  508.                   </div>
  509.                 {% endif %}
  510.               </div>
  511.  
  512.               {% if j3.settings.get('catalogWishlistStatus') or j3.settings.get('catalogCompareStatus') or j3.document.isPopup('quickview') %}
  513.               <div class="wishlist-compare">
  514.                 {% if not j3.document.isPopup('options') %}
  515.                   {% if j3.settings.get('catalogWishlistStatus') %}
  516.                   <a class="btn btn-wishlist" {% if (j3.settings.get(stylePrefix ~ 'WishlistDisplay') == "icon") and (j3.settings.get(stylePrefix ~ 'WishlistTooltipStatus')) %} data-toggle="tooltip" data-tooltip-class="pp-wishlist-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'WishlistTooltipPosition') }}" title="{{ button_wishlist }}" {% endif %} onclick="parent.wishlist.add({{ product_id }});"><span class="btn-text">{{ button_wishlist }}</span></a>
  517.                   {% endif %}
  518.  
  519.                   {% if j3.settings.get('catalogCompareStatus') %}
  520.                   <a class="btn btn-compare" {% if (j3.settings.get(stylePrefix ~ 'CompareDisplay') == "icon") and (j3.settings.get(stylePrefix ~ 'CompareTooltipStatus')) %} data-toggle="tooltip" data-tooltip-class="pp-compare-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'CompareTooltipPosition') }}" title="{{ button_compare }}" {% endif %} onclick="parent.compare.add({{ product_id }});"><span class="btn-text">{{ button_compare }}</span></a>
  521.                   {% endif %}
  522.                 {% endif %}
  523.                 {% if j3.document.isPopup('quickview') %}
  524.                   <a class="btn btn-more-details" href="{{ view_more_url }}" target="_top" {% if (j3.settings.get(stylePrefix ~ 'MoreDetailsDisplay') == "icon") and (j3.settings.get(stylePrefix ~ 'MoreDetailsTooltipStatus')) %} data-toggle="tooltip" data-tooltip-class="more-details-tooltip" data-placement="{{ j3.settings.get(stylePrefix ~ 'MoreDetailsTooltipPosition') }}" title="{{ j3.settings.get('quickviewExtraText') }}" {% endif %}><span class="btn-text">{{ j3.settings.get('quickviewExtraText') }}</span></a>
  525.                 {% endif %}
  526.               </div>
  527.               {% endif %}
  528.             </div>
  529.           </div>
  530.           {% endif %}
  531.  
  532.           {% if minimum > 1 %}
  533.             <div class="minimum alert alert-info"><i class="fa fa-info-circle"></i> {{ text_minimum }}</div>
  534.           {% endif %}
  535.  
  536.           {% if not j3.document.isPopup('options') %}
  537.             {% if product_blocks.details %}
  538.                 {{ product_blocks.details|join }}
  539.             {% endif %}
  540.           {% endif %}
  541.           </div>
  542.           {% if not j3.document.isPopup('options') %}
  543.           {% if product_blocks.bottom %}
  544.           <div class="product-blocks blocks-bottom">
  545.             {{ product_blocks.bottom|join }}
  546.           </div>
  547.           {% endif %}
  548.           {% endif %}
  549.           {% if tags and not j3.document.isPopup() and (j3.settings.get(stylePrefix ~ 'TagsPosition') == 'details') %}
  550.             <div class="tags">
  551.               <span class="tags-title">{{ text_tags }}</span>
  552.               {% for tag in tags %}
  553.                 <a href="{{ tag.href }}">{{ tag.tag }}</a>
  554.                 {% if not loop.last %}<b>,</b>{% endif %}
  555.               {% endfor %}
  556.             </div>
  557.           {% endif %}
  558.         </div>
  559.       </div>
  560.       {% if description and j3.document.isPopup('quickview') and j3.settings.get('quickviewDescription') and (j3.settings.get('quickviewDescriptionPosition') == 'default') %}
  561.         <div class="description {{ quickviewExpand }}">
  562.           <div class="expand-block">
  563.             <div class="expand-content">
  564.               {{ description }}
  565.             </div>
  566.             {% if j3.settings.get('quickviewExpandButton') %}
  567.               <div class="block-expand-overlay"><a class="block-expand btn"></a></div>
  568.             {% endif %}
  569.           </div>
  570.         </div>
  571.       {% endif %}
  572.       {% if not j3.document.isPopup('options') %}
  573.         {% if product_blocks.default %}
  574.         <div class="product-blocks blocks-default">
  575.           {{ product_blocks.default|join }}
  576.         </div>
  577.         {% endif %}
  578.       {% endif %}
  579.       {% if tags and not j3.document.isPopup() and (j3.settings.get(stylePrefix ~ 'TagsPosition') == 'default') %}
  580.         <div class="tags">
  581.           <span class="tags-title">{{ text_tags }}</span>
  582.           {% for tag in tags %}
  583.             <a href="{{ tag.href }}">{{ tag.tag }}</a>
  584.             {% if not loop.last %}<b>,</b>{% endif %}
  585.           {% endfor %}
  586.         </div>
  587.       {% endif %}
  588.       {% if not j3.document.isPopup() %}
  589.       {{ content_bottom }}</div>
  590.     {{ column_right }}</div>
  591. </div>
  592. {% endif %}
  593. <script type="text/javascript"><!--
  594. $('select[name=\'recurring_id\'], input[name="quantity"]').change(function(){
  595.     $.ajax({
  596.         url: 'index.php?route=product/product/getRecurringDescription',
  597.         type: 'post',
  598.         data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
  599.         dataType: 'json',
  600.         beforeSend: function() {
  601.             $('#recurring-description').html('');
  602.         },
  603.         success: function(json) {
  604.             $('.alert-dismissible, .text-danger').remove();
  605.  
  606.             if (json['success']) {
  607.                 $('#recurring-description').html(json['success']);
  608.             }
  609.         }
  610.     });
  611. });
  612. //--></script>
  613. <script type="text/javascript"><!--
  614. $('#button-cart, [data-quick-buy]').on('click', function () {
  615.  var $btn = $(this);
  616.  $.ajax({
  617.    url: 'index.php?route=checkout/cart/add',
  618.    type: 'post',
  619.    data: $(
  620.      '#product .button-group-page input[type=\'text\'], #product .button-group-page input[type=\'hidden\'], #product .button-group-page input[type=\'radio\']:checked, #product .button-group-page input[type=\'checkbox\']:checked, #product .button-group-page select, #product .button-group-page textarea, ' +
  621.      '#product .product-options input[type=\'text\'], #product .product-options input[type=\'hidden\'], #product .product-options input[type=\'radio\']:checked, #product .product-options input[type=\'checkbox\']:checked, #product .product-options select, #product .product-options textarea, ' +
  622.      '#product select[name="recurring_id"]'
  623.    ),
  624.    dataType: 'json',
  625.    beforeSend: function () {
  626.      $('#button-cart').button('loading');
  627.    },
  628.    complete: function () {
  629.      $('#button-cart').button('reset');
  630.    },
  631.    success: function (json) {
  632.      $('.alert-dismissible, .text-danger').remove();
  633.      $('.form-group').removeClass('has-error');
  634.  
  635.      if (json['error']) {
  636.        if (json['error']['option']) {
  637.          for (i in json['error']['option']) {
  638.            var element = $('#input-option' + i.replace('_', '-'));
  639.  
  640.            if (element.parent().hasClass('input-group')) {
  641.              element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
  642.            } else {
  643.              element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
  644.            }
  645.          }
  646.        }
  647.  
  648.        if (json['error']['recurring']) {
  649.          $('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
  650.        }
  651.  
  652.        // Highlight any found errors
  653.        $('.text-danger').parent().addClass('has-error');
  654.  
  655.        try {
  656.          $('html, body').animate({ scrollTop: $('.form-group.has-error').offset().top - $('header').height() - 20 }, 'slow');
  657.        } catch (e) {
  658.        }
  659.      }
  660.  
  661.      if (json['success']) {
  662.        if ($('html').hasClass('popup-options')) {
  663.          parent.$(".popup-options .popup-close").trigger('click');
  664.        }
  665.  
  666.        if (json['notification']) {
  667.          parent.show_notification(json['notification']);
  668.        } else {
  669.          parent.$('#content').parent().before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
  670.        }
  671.  
  672.        parent.$('#cart-total').html(json['total']);
  673.        parent.$('#cart-items,.cart-badge').html(json['items_count']);
  674.  
  675.        if (json['items_count']) {
  676.          parent.$('#cart-items,.cart-badge').removeClass('count-zero');
  677.        } else {
  678.          parent.$('#cart-items,.cart-badge').addClass('count-zero');
  679.        }
  680.  
  681.        if (Journal['scrollToTop']) {
  682.          parent.$('html, body').animate({ scrollTop: 0 }, 'slow');
  683.        }
  684.  
  685.        parent.$('.cart-content ul').load('index.php?route=common/cart/info ul li');
  686.  
  687.        if (window.location.href.indexOf('quick_buy=true') !== -1) {
  688.          parent.location.href = Journal['checkoutUrl'];
  689.        }
  690.  
  691.        if ($btn.data('quick-buy') !== undefined) {
  692.          location = Journal['checkoutUrl'];
  693.        }
  694.  
  695.        if (parent.window['_QuickCheckout']) {
  696.          parent.window['_QuickCheckout'].save();
  697.        }
  698.  
  699.        if (json['redirect']) {
  700.          parent.location.href = json['redirect'];
  701.        }
  702.      }
  703.    },
  704.    error: function (xhr, ajaxOptions, thrownError) {
  705.      alert(thrownError + '\r\n' + xhr.statusText + '\r\n' + xhr.responseText);
  706.    }
  707.  });
  708. });
  709. //--></script>
  710. <script type="text/javascript"><!--
  711. $('.date').datetimepicker({
  712.     language: '{{ datepicker }}',
  713.     pickTime: false
  714. });
  715.  
  716. $('.datetime').datetimepicker({
  717.     language: '{{ datepicker }}',
  718.     pickDate: true,
  719.     pickTime: true
  720. });
  721.  
  722. $('.time').datetimepicker({
  723.     language: '{{ datepicker }}',
  724.     pickDate: false
  725. });
  726.  
  727. $('button[id^=\'button-upload\']').on('click', function() {
  728.     var node = this;
  729.  
  730.     $('#form-upload').remove();
  731.  
  732.     $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');
  733.  
  734.     $('#form-upload input[name=\'file\']').trigger('click');
  735.  
  736.     if (typeof timer != 'undefined') {
  737.         clearInterval(timer);
  738.     }
  739.  
  740.     timer = setInterval(function() {
  741.         if ($('#form-upload input[name=\'file\']').val() != '') {
  742.             clearInterval(timer);
  743.  
  744.             $.ajax({
  745.                 url: 'index.php?route=tool/upload',
  746.                 type: 'post',
  747.                 dataType: 'json',
  748.                 data: new FormData($('#form-upload')[0]),
  749.                 cache: false,
  750.                 contentType: false,
  751.                 processData: false,
  752.                 beforeSend: function() {
  753.                     $(node).button('loading');
  754.                 },
  755.                 complete: function() {
  756.                     $(node).button('reset');
  757.                 },
  758.                 success: function(json) {
  759.                     $('.text-danger').remove();
  760.  
  761.                     if (json['error']) {
  762.                         $(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
  763.                     }
  764.  
  765.                     if (json['success']) {
  766.                         alert(json['success']);
  767.  
  768.                         $(node).parent().find('input').val(json['code']);
  769.                     }
  770.                 },
  771.                 error: function(xhr, ajaxOptions, thrownError) {
  772.                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
  773.                 }
  774.             });
  775.         }
  776.     }, 500);
  777. });
  778. //--></script>
  779. <script type="text/javascript"><!--
  780. $(function () {
  781.  $('#review').delegate('.pagination a', 'click', function(e) {
  782.    e.preventDefault();
  783.  
  784.    $('#review').fadeOut('slow');
  785.  
  786.    $('#review').load(this.href);
  787.  
  788.    $('#review').fadeIn('slow');
  789.  });
  790.  
  791.  $('#review').load('index.php?route=product/product/review&product_id={{ product_id }}');
  792.  
  793.  $('#button-review').on('click', function() {
  794.    $.ajax({
  795.      url: 'index.php?route=product/product/write&product_id={{ product_id }}',
  796.      type: 'post',
  797.      dataType: 'json',
  798.      data: $("#form-review").serialize(),
  799.      beforeSend: function() {
  800.        $('#button-review').button('loading');
  801.      },
  802.      complete: function() {
  803.        $('#button-review').button('reset');
  804.      },
  805.      success: function(json) {
  806.        $('.alert-dismissible').remove();
  807.  
  808.        if (json['error']) {
  809.          $('#review').after('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
  810.        }
  811.  
  812.        if (json['success']) {
  813.          $('#review').after('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
  814.  
  815.          $('input[name=\'name\']').val('');
  816.          $('textarea[name=\'text\']').val('');
  817.          $('input[name=\'rating\']:checked').prop('checked', false);
  818.        }
  819.      }
  820.    });
  821.  });
  822. });
  823.  
  824. $(document).ready(function() {
  825.     $('.thumbnails').magnificPopup({
  826.         type:'image',
  827.         delegate: 'a',
  828.         gallery: {
  829.             enabled: true
  830.         }
  831.     });
  832. });
  833.  
  834. $(document).ready(function () {
  835.  $('.review-links a').on('click', function () {
  836.    var $review = $('#review');
  837.    if ($review.length) {
  838.      $('a[href="#' + $review.closest('.module-item').attr('id') + '"]').trigger('click');
  839.      $('a[href="#' + $review.closest('.tab-pane').attr('id') + '"]').trigger('click');
  840.      $('a[href="#' + $review.closest('.panel-collapse').attr('id') + '"]').trigger('click');
  841.      $review.closest('.expand-block').find('.block-expand.btn').trigger('click');
  842.  
  843.      $([document.documentElement, document.body]).animate({
  844.        scrollTop: $review.offset().top - $('header').height() - 20
  845.      }, 200);
  846.    }
  847.  });
  848. });
  849. //--></script>
  850. {% if not j3.document.isPopup() %}
  851. {{ j3.loadController('journal3/seo/rich_snippets', breadcrumbs) }}
  852. {% endif %}
  853. {{ footer }}
  854.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement