Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 48.70 KB | None | 0 0
  1. <?php echo $header;
  2. $theme_options = $registry->get('theme_options');
  3. $config = $registry->get('config');
  4. $page_direction = $theme_options->get( 'page_direction' ); $language_id = $config->get( 'config_language_id' );
  5. $background_status = false;
  6. $product_page = true;
  7. include('catalog/view/theme/'.$config->get('theme_' . $config->get('config_theme') . '_directory').'/template/new_elements/wrapper_top.tpl'); ?>
  8.  
  9. <?php if(!isset($page_direction[$language_id])) {
  10.     $page_direction[$language_id] = false;
  11. } ?>
  12.  
  13. <div itemscope itemtype="http://schema.org/Product">
  14.   <span itemprop="name" class="hidden"><?php echo $heading_title; ?></span>
  15.   <div class="product-info">
  16.     <div class="row">
  17.          <?php $product_custom_block = $modules_old_opencart->getModules('product_custom_block'); ?>
  18.         <div class="col-md-<?php if($theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'status' ) == 1 || count($product_custom_block)) { echo 9; } else { echo 12; } ?> col-sm-12">
  19.             <div class="row" id="quickview_product">
  20.                 <?php if($theme_options->get( 'product_image_zoom' ) != 2) { ?>
  21.                 <script>
  22.                     $(document).ready(function(){
  23.                          if($(window).width() > 992) {
  24.                             <?php if($theme_options->get( 'product_image_zoom' ) == 1) { ?>
  25.                                 $('#image').elevateZoom({
  26.                                     zoomType: "inner",
  27.                                     cursor: "pointer",
  28.                                     zoomWindowFadeIn: 500,
  29.                                     zoomWindowFadeOut: 750
  30.                                 });
  31.                             <?php } else { ?>
  32.                                 $('#image').elevateZoom({
  33.                                     zoomWindowFadeIn: 500,
  34.                                     zoomWindowFadeOut: 500,
  35.                                     zoomWindowOffetx: 20,
  36.                                     zoomWindowOffety: -1,
  37.                                     cursor: "pointer",
  38.                                     lensFadeIn: 500,
  39.                                     lensFadeOut: 500,
  40.                                     zoomWindowWidth: 500,
  41.                                     zoomWindowHeight: 500
  42.                                 });
  43.                             <?php } ?>
  44.                            
  45.                             var z_index = 0;
  46.                            
  47.                             $(document).on('click', '.open-popup-image', function () {
  48.                               $('.popup-gallery').magnificPopup('open', z_index);
  49.                               return false;
  50.                             });
  51.                        
  52.                             $('.thumbnails a, .thumbnails-carousel a').click(function() {
  53.                                 var smallImage = $(this).attr('data-image');
  54.                                 var largeImage = $(this).attr('data-zoom-image');
  55.                                 var ez =   $('#image').data('elevateZoom');
  56.                                 $('#ex1').attr('href', largeImage);  
  57.                                 ez.swaptheimage(smallImage, largeImage);
  58.                                 z_index = $(this).index('.thumbnails a, .thumbnails-carousel a');
  59.                                 return false;
  60.                             });
  61.                         } else {
  62.                             $(document).on('click', '.open-popup-image', function () {
  63.                               $('.popup-gallery').magnificPopup('open', 0);
  64.                               return false;
  65.                             });
  66.                         }
  67.                     });
  68.                 </script>
  69.                 <?php } ?>
  70.                 <?php $image_grid = 7; $product_center_grid = 5;
  71.                 if ($theme_options->get( 'product_image_size' ) == 1) {
  72.                     $image_grid = 4; $product_center_grid = 8;
  73.                 }
  74.                
  75.                 if ($theme_options->get( 'product_image_size' ) == 3) {
  76.                     $image_grid = 8; $product_center_grid = 4;
  77.                 }
  78.                 ?>
  79.                 <div class="col-sm-<?php echo $image_grid; ?> popup-gallery">
  80.                   <?php
  81.                   $product_image_top = $modules_old_opencart->getModules('product_image_top');
  82.                   if( count($product_image_top) ) {
  83.                     foreach ($product_image_top as $module) {
  84.                         echo $module;
  85.                     }
  86.                   } ?>
  87.                      
  88.                   <div class="row">
  89.                       <?php if (($images || $theme_options->get( 'product_image_zoom' ) != 2) && $theme_options->get( 'position_image_additional' ) == 2) { ?>
  90.                       <div class="col-sm-2">
  91.                         <div class="thumbnails thumbnails-left clearfix">
  92.                             <ul>
  93.                               <?php if($theme_options->get( 'product_image_zoom' ) != 2 && $thumb) { ?>
  94.                               <li><p><a href="<?php echo $popup; ?>" class="popup-image" data-image="<?php echo $thumb; ?>" data-zoom-image="<?php echo $popup; ?>"><img src="<?php echo $theme_options->productImageThumb($product_id, $config->get('theme_default_image_additional_width'), $config->get('theme_default_image_additional_height')); ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></p></li>
  95.                               <?php } ?>
  96.                               <?php foreach ($images as $image) { ?>
  97.                               <li><p><a href="<?php echo $image['popup']; ?>" class="popup-image" data-image="<?php echo $image['popup']; ?>" data-zoom-image="<?php echo $image['popup']; ?>"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></p></li>
  98.                               <?php } ?>
  99.                           </ul>
  100.                         </div>
  101.                       </div>
  102.                       <?php } ?>
  103.                      
  104.                       <div class="col-sm-<?php if($theme_options->get( 'position_image_additional' ) == 2) { echo 10; } else { echo 12; } ?>">
  105.                         <?php if ($thumb) { ?>
  106.                           <div class="product-image <?php if($theme_options->get( 'product_image_zoom' ) != 2) { if($theme_options->get( 'product_image_zoom' ) == 1) { echo 'inner-cloud-zoom'; } else { echo 'cloud-zoom'; } } ?>">
  107.                              <?php if($special && $theme_options->get( 'display_text_sale' ) != '0') { ?>
  108.                                 <?php $text_sale = 'Sale';
  109.                                 if($theme_options->get( 'sale_text', $config->get( 'config_language_id' ) ) != '') {
  110.                                     $text_sale = $theme_options->get( 'sale_text', $config->get( 'config_language_id' ) );
  111.                                 } ?>
  112.                                 <?php if($theme_options->get( 'type_sale' ) == '1') { ?>
  113.                                 <?php $product_detail = $theme_options->getDataProduct( $product_id );
  114.                                 $roznica_ceny = $product_detail['price']-$product_detail['special'];
  115.                                 $procent = ($roznica_ceny*100)/$product_detail['price']; ?>
  116.                                 <div class="sale">-<?php echo round($procent); ?>%</div>
  117.                                 <?php } else { ?>
  118.                                 <div class="sale"><?php echo $text_sale; ?></div>
  119.                                 <?php } ?>
  120.                              <?php } elseif($theme_options->get( 'display_text_new' ) != '0' && $theme_options->isLatestProduct( $product_id )) { ?>
  121.                                  <div class="new"><?php if($theme_options->get( 'new_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'new_text', $config->get( 'config_language_id' ) ); } else { echo 'New'; } ?></div>
  122.                              <?php } ?>
  123.                              
  124.                              <a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" id="ex1" <?php if($theme_options->get( 'product_image_zoom' ) == 2) { ?>class="popup-image"<?php } else { echo 'class="open-popup-image"'; } ?>><img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" itemprop="image" data-zoom-image="<?php echo $popup; ?>" /></a>
  125.                           </div>
  126.                          <?php } else { ?>
  127.                          <div class="product-image">
  128.                              <img src="image/no_image.jpg" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image" itemprop="image" />
  129.                          </div>
  130.                          <?php } ?>
  131.                       </div>
  132.                      
  133.                       <?php if (($images || $theme_options->get( 'product_image_zoom' ) != 2) && $theme_options->get( 'position_image_additional' ) != 2) { ?>
  134.                       <div class="col-sm-12">
  135.                            <div class="overflow-thumbnails-carousel clearfix">
  136.                               <div class="thumbnails-carousel owl-carousel">
  137.                                 <?php if($theme_options->get( 'product_image_zoom' ) != 2 && $thumb) { ?>
  138.                                      <div class="item"><a href="<?php echo $popup; ?>" class="popup-image" data-image="<?php echo $thumb; ?>" data-zoom-image="<?php echo $popup; ?>"><img src="<?php echo $theme_options->productImageThumb($product_id, $config->get('theme_default_image_additional_width'), $config->get('theme_default_image_additional_height')); ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></div>
  139.                                 <?php } ?>
  140.                                  <?php foreach ($images as $image) { ?>
  141.                                      <div class="item"><a href="<?php echo $image['popup']; ?>" class="popup-image" data-image="<?php echo $image['popup']; ?>" data-zoom-image="<?php echo $image['popup']; ?>"><img src="<?php echo $image['thumb']; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" /></a></div>
  142.                                  <?php } ?>
  143.                               </div>
  144.                           </div>
  145.                          
  146.                           <script type="text/javascript">
  147.                                $(document).ready(function() {
  148.                                  $(".thumbnails-carousel").owlCarousel({
  149.                                      autoPlay: 6000, //Set AutoPlay to 3 seconds
  150.                                      navigation: true,
  151.                                      navigationText: ['', ''],
  152.                                      itemsCustom : [
  153.                                        [0, 4],
  154.                                        [450, 5],
  155.                                        [550, 6],
  156.                                        [768, 3],
  157.                                        [1200, 4]
  158.                                      ],
  159.                                      <?php if($page_direction[$language_id] == 'RTL'): ?>
  160.                                      direction: 'rtl'
  161.                                      <?php endif; ?>
  162.                                  });
  163.                                });
  164.                           </script>
  165.                       </div>
  166.                       <?php } ?>
  167.                   </div>
  168.                  
  169.                   <?php
  170.                   $product_image_bottom = $modules_old_opencart->getModules('product_image_bottom');
  171.                   if( count($product_image_bottom) ) {
  172.                     foreach ($product_image_bottom as $module) {
  173.                         echo $module;
  174.                     }
  175.                   } ?>
  176.                 </div>
  177.  
  178.                 <div class="col-sm-<?php echo $product_center_grid; ?> product-center clearfix">
  179.                  <div itemscope itemtype="http://schema.org/Offer">
  180.                   <?php
  181.                   $product_options_top = $modules_old_opencart->getModules('product_options_top');
  182.                   if( count($product_options_top) ) {
  183.                     foreach ($product_options_top as $module) {
  184.                         echo $module;
  185.                     }
  186.                   } ?>
  187.                  
  188.                   <?php if ($review_status) { ?>
  189.                   <div class="review">
  190.                     <?php if($rating > 0) { ?>
  191.                     <span itemprop="review" class="hidden" itemscope itemtype="http://schema.org/Review-aggregate">
  192.                         <span itemprop="itemreviewed"><?php echo $heading_title; ?></span>
  193.                         <span itemprop="rating"><?php echo $rating; ?></span>
  194.                         <span itemprop="votes"><?php preg_match_all('/\(([0-9]+)\)/', $tab_review, $wyniki);
  195.                         if(isset($wyniki[1][0])) { echo $wyniki[1][0]; } else { echo 0; } ?></span>
  196.                     </span>
  197.                     <?php } ?>
  198.                     <div class="rating"><i class="fa fa-star<?php if($rating >= 1) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($rating >= 2) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($rating >= 3) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($rating >= 4) { echo ' active'; } ?>"></i><i class="fa fa-star<?php if($rating >= 5) { echo ' active'; } ?>"></i>&nbsp;&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click'); $('html, body').animate({scrollTop:$('#tab-review').offset().top}, '500', 'swing');"><?php echo $reviews; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click'); $('html, body').animate({scrollTop:$('#tab-review').offset().top}, '500', 'swing');"><?php echo $text_write; ?></a></div>
  199.                     <?php if($theme_options->get( 'product_social_share' ) != '0') { ?>
  200.                     <div class="share">
  201.                         <!-- AddThis Button BEGIN -->
  202.                         <div class="addthis_toolbox addthis_default_style"><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_pinterest_pinit"></a> <a class="addthis_counter addthis_pill_style"></a></div>
  203.                         <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-515eeaf54693130e"></script>
  204.                         <!-- AddThis Button END -->
  205.                     </div>
  206.                     <?php } ?>
  207.                   </div>
  208.                   <?php } ?>
  209.                  
  210.                   <div class="description">
  211.                     <?php if ($manufacturer) { ?>
  212.                     <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
  213.                     <?php } ?>
  214.                     <!-- <span><?php echo $text_model; ?></span> <?php echo $model; ?><br /> -->
  215.                     <?php if ($reward) { ?>
  216.                     <span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
  217.                     <?php } ?>
  218.                     <span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>
  219.                   <?php if ($price) { ?>
  220.                   <div class="price">
  221.                     <?php if($theme_options->get( 'display_specials_countdown' ) == '1' && $special) { $countdown = rand(0, 5000)*rand(0, 5000);
  222.                               $product_detail = $theme_options->getDataProduct( $product_id );
  223.                               $date_end = $product_detail['date_end'];
  224.                               if($date_end != '0000-00-00' && $date_end) { ?>
  225.                                 <script>
  226.                                 $(function () {
  227.                                     var austDay = new Date();
  228.                                     austDay = new Date(<?php echo date("Y", strtotime($date_end)); ?>, <?php echo date("m", strtotime($date_end)); ?> - 1, <?php echo date("d", strtotime($date_end)); ?>);
  229.                                     $('#countdown<?php echo $countdown; ?>').countdown({until: austDay});
  230.                                 });
  231.                                 </script>
  232.                                 <h3><?php if($theme_options->get( 'limited_time_offer_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'limited_time_offer_text', $config->get( 'config_language_id' ) ); } else { echo 'Limited time offer'; } ?></h3>
  233.                                 <div id="countdown<?php echo $countdown; ?>" class="clearfix"></div>
  234.                              <?php } ?>
  235.                     <?php } ?>
  236.                     <?php if (!$special) { ?>
  237.                     <span class="price-new"><span itemprop="price" id="price-old"><?php if($price == "$0.00") { echo "BUY NOW"; } else { echo $price;} ?></span></span>
  238.                     <?php } else { ?>
  239.                     <span class="price-new"><span itemprop="price" id="price-special"><?php echo $special; ?></span></span> <span class="price-old" id="price-old"><?php echo $price; ?></span>
  240.                     <?php } ?>
  241.                     <br />
  242.                     <?php if ($tax) { ?>
  243.                     <span class="price-tax"><?php echo $text_tax; ?> <span id="price-tax"><?php echo $tax; ?></span></span><br />
  244.                     <?php } ?>
  245.                     <?php if ($points) { ?>
  246.                     <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br />
  247.                     <?php } ?>
  248.                     <?php if ($discounts) { ?>
  249.                     <br />
  250.                     <div class="discount">
  251.                       <?php foreach ($discounts as $discount) { ?>
  252.                       <?php echo $discount['quantity']; ?><?php echo $text_discount; ?><?php echo $discount['price']; ?><br />
  253.                       <?php } ?>
  254.                     </div>
  255.                     <?php } ?>
  256.                   </div>
  257.                   <?php } ?>
  258.                  </div>
  259.                  
  260.                  <div id="product">
  261.                   <?php $product_options_center = $modules_old_opencart->getModules('product_options_center'); ?>
  262.                   <?php if ($options || count($product_options_center)) { ?>
  263.                   <div class="options">
  264.                     <?php foreach ($product_options_center as $module) { echo $module; } ?>
  265.                    
  266.                     <?php if ($options) { ?>
  267.                     <div class="options2">
  268.                         <h2><?php echo $text_option; ?></h2>
  269.                         <?php foreach ($options as $option) { ?>
  270.                         <?php if ($option['type'] == 'select') { ?>
  271.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  272.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  273.                           <select name="option[<?php echo $option['product_option_id']; ?>]" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control">
  274.                             <option value=""><?php echo $text_select; ?></option>
  275.                             <?php foreach ($option['product_option_value'] as $option_value) { ?>
  276.                             <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
  277.                             <?php if ($option_value['price']) { ?>
  278.                             (<?php echo $option_value['price']; ?>)
  279.                             <?php } ?>
  280.                             </option>
  281.                             <?php } ?>
  282.                           </select>
  283.                         </div>
  284.                         <?php } ?>
  285.                          <?php if ($option['type'] == 'radio') { ?>
  286.                          <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  287.                            <label class="control-label"><?php echo $option['name']; ?></label>
  288.                            <div id="input-option<?php echo $option['product_option_id']; ?>">
  289.                              <?php foreach ($option['product_option_value'] as $option_value) { ?>
  290.                              <div class="radio <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { echo 'radio-type-button2'; } ?>">
  291.                                <label>
  292.                                  <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" />
  293.                                  <span <?php if ($option_value['image']) { echo 'style="padding: 2px"'; } ?>><?php if (!$option_value['image']) { ?><?php echo $option_value['name']; ?><?php } ?>
  294.                                  <?php if ($option_value['image']) { ?>
  295.                                  <img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>"  style="display: block;border-radius: 100px;-webkit-border-radius: 100px;-moz-border-radius: 100px" class="img-thumbnail" />
  296.                                  <?php } ?>
  297.                                  <?php if($theme_options->get( 'product_page_radio_style' ) != 1) { ?><?php if ($option_value['price']) { ?>
  298.                                  (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
  299.                                  <?php } ?><?php } ?></span>
  300.                                </label>
  301.                              </div>
  302.                              <?php } ?>
  303.                              
  304.                              <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { ?>
  305.                              <script type="text/javascript">
  306.                                   $(document).ready(function(){
  307.                                        $('#input-option<?php echo $option['product_option_id']; ?>').on('click', 'span', function () {
  308.                                             $('#input-option<?php echo $option['product_option_id']; ?> span').removeClass("active");
  309.                                             $(this).addClass("active");
  310.                                        });
  311.                                   });
  312.                              </script>
  313.                              <?php } ?>
  314.                            </div>
  315.                          </div>
  316.                          <?php } ?>
  317.                         <?php if ($option['type'] == 'checkbox') { ?>
  318.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  319.                           <label class="control-label"><?php echo $option['name']; ?></label>
  320.                           <div id="input-option<?php echo $option['product_option_id']; ?>">
  321.                             <?php foreach ($option['product_option_value'] as $option_value) { ?>
  322.                             <div class="checkbox <?php if($theme_options->get( 'product_page_checkbox_style' ) == 1) { echo 'radio-type-button2'; } ?>">
  323.                               <label>
  324.                                 <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" />
  325.                                 <span><?php echo $option_value['name']; ?>
  326.                                 <?php if($theme_options->get( 'product_page_checkbox_style' ) != 1) { ?><?php if ($option_value['price']) { ?>
  327.                                 (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
  328.                                 <?php } ?><?php } ?></span>
  329.                               </label>
  330.                             </div>
  331.                             <?php } ?>
  332.                            
  333.                             <?php if($theme_options->get( 'product_page_checkbox_style' ) == 1) { ?>
  334.                             <script type="text/javascript">
  335.                                  $(document).ready(function(){
  336.                                       $('#input-option<?php echo $option['product_option_id']; ?>').on('click', 'span', function () {
  337.                                            if($(this).hasClass("active") == true) {
  338.                                                 $(this).removeClass("active");
  339.                                            } else {
  340.                                                 $(this).addClass("active");
  341.                                            }
  342.                                       });
  343.                                  });
  344.                             </script>
  345.                             <?php } ?>
  346.                           </div>
  347.                         </div>
  348.                         <?php } ?>
  349.                         <?php if ($option['type'] == 'image') { ?>
  350.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  351.                           <label class="control-label"><?php echo $option['name']; ?></label>
  352.                           <div id="input-option<?php echo $option['product_option_id']; ?>">
  353.                             <?php foreach ($option['product_option_value'] as $option_value) { ?>
  354.                             <div class="radio <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { echo 'radio-type-button'; } ?>">
  355.                               <label>
  356.                                 <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" />
  357.                                 <span <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { ?>data-toggle="tooltip" data-placement="top" title="<?php echo $option_value['name']; ?> <?php if ($option_value['price']) { ?>(<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)<?php } ?>"<?php } ?>><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { ?>width="<?php if($theme_options->get( 'product_page_radio_image_width' ) > 0) { echo $theme_options->get( 'product_page_radio_image_width' ); } else { echo 25; } ?>px" height="<?php if($theme_options->get( 'product_page_radio_image_height' ) > 0) { echo $theme_options->get( 'product_page_radio_image_height' ); } else { echo 25; } ?>px"<?php } ?> /> <?php if($theme_options->get( 'product_page_radio_style' ) != 1) { ?><?php echo $option_value['name']; ?>
  358.                                 <?php if ($option_value['price']) { ?>
  359.                                 (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
  360.                                 <?php } ?><?php } ?></span>
  361.                               </label>
  362.                             </div>
  363.                             <?php } ?>
  364.                             <?php if($theme_options->get( 'product_page_radio_style' ) == 1) { ?>
  365.                             <script type="text/javascript">
  366.                                  $(document).ready(function(){
  367.                                       $('#input-option<?php echo $option['product_option_id']; ?>').on('click', 'span', function () {
  368.                                            $('#input-option<?php echo $option['product_option_id']; ?> span').removeClass("active");
  369.                                            $(this).addClass("active");
  370.                                       });
  371.                                  });
  372.                             </script>
  373.                             <?php } ?>
  374.                           </div>
  375.                         </div>
  376.                         <?php } ?>
  377.                         <?php if ($option['type'] == 'text') { ?>
  378.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  379.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  380.                           <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
  381.                         </div>
  382.                         <?php } ?>
  383.                         <?php if ($option['type'] == 'textarea') { ?>
  384.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  385.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  386.                           <textarea name="option[<?php echo $option['product_option_id']; ?>]" rows="5" placeholder="<?php echo $option['name']; ?>" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control"><?php echo $option['value']; ?></textarea>
  387.                         </div>
  388.                         <?php } ?>
  389.                         <?php if ($option['type'] == 'file') { ?>
  390.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  391.                           <label class="control-label"><?php echo $option['name']; ?></label>
  392.                           <button type="button" id="button-upload<?php echo $option['product_option_id']; ?>" class="btn btn-default btn-block" style="margin-top: 7px"><i class="fa fa-upload"></i> <?php echo $button_upload; ?></button>
  393.                           <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" id="input-option<?php echo $option['product_option_id']; ?>" />
  394.                         </div>
  395.                         <?php } ?>
  396.                         <?php if ($option['type'] == 'date') { ?>
  397.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  398.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  399.                           <div class="input-group date">
  400.                             <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
  401.                             <span class="input-group-btn">
  402.                             <button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
  403.                             </span></div>
  404.                         </div>
  405.                         <?php } ?>
  406.                         <?php if ($option['type'] == 'datetime') { ?>
  407.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  408.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  409.                           <div class="input-group datetime">
  410.                             <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="YYYY-MM-DD HH:mm" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
  411.                             <span class="input-group-btn">
  412.                             <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  413.                             </span></div>
  414.                         </div>
  415.                         <?php } ?>
  416.                         <?php if ($option['type'] == 'time') { ?>
  417.                         <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
  418.                           <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
  419.                           <div class="input-group time">
  420.                             <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" data-date-format="HH:mm" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control" />
  421.                             <span class="input-group-btn">
  422.                             <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
  423.                             </span></div>
  424.                         </div>
  425.                         <?php } ?>
  426.                         <?php } ?>
  427.                    </div>
  428.                     <?php } ?>
  429.                   </div>
  430.                   <?php } ?>
  431.                  
  432.                   <?php if ($recurrings) { ?>
  433.                   <div class="options">
  434.                       <h2><?php echo $text_payment_recurring ?></h2>
  435.                       <div class="form-group required">
  436.                         <select name="recurring_id" class="form-control">
  437.                           <option value=""><?php echo $text_select; ?></option>
  438.                           <?php foreach ($recurrings as $recurring) { ?>
  439.                           <option value="<?php echo $recurring['recurring_id'] ?>"><?php echo $recurring['name'] ?></option>
  440.                           <?php } ?>
  441.                         </select>
  442.                         <div class="help-block" id="recurring-description"></div>
  443.                       </div>
  444.                   </div>
  445.                   <?php } ?>
  446.                  
  447.                   <div class="cart">
  448.                     <div class="add-to-cart clearfix">
  449.                       <?php
  450.                       $product_enquiry = $modules_old_opencart->getModules('product_enquiry');
  451.                       if( count($product_enquiry) ) {
  452.                         foreach ($product_enquiry as $module) {
  453.                             echo $module;
  454.                         }
  455.                       } else { ?>
  456.                           <p><?php echo $entry_qty; ?></p>
  457.                           <div class="quantity">
  458.                               <input type="text" name="quantity" id="quantity_wanted" size="2" value="<?php echo $minimum; ?>" />
  459.                               <a href="#" id="q_up"><i class="fa fa-plus"></i></a>
  460.                               <a href="#" id="q_down"><i class="fa fa-minus"></i></a>
  461.                           </div>
  462.  
  463.                           <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
  464.                           <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" rel="<?php echo $product_id; ?>" data-loading-text="<?php echo $text_loading; ?>" class="button" <?php if ($stock == "Out Of Stock") echo "disabled"; ?> />
  465.                          
  466.                           <?php
  467.                           $product_question = $modules_old_opencart->getModules('product_question');
  468.                           if( count($product_question) ) {
  469.                             foreach ($product_question as $module) {
  470.                                 echo $module;
  471.                             }
  472.                           } ?>
  473.                       <?php } ?>
  474.                     </div>
  475.                    
  476.                     <div class="links clearfix">
  477.                         <a onclick="wishlist.add('<?php echo $product_id; ?>');"><?php if($theme_options->get( 'add_to_wishlist_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'add_to_wishlist_text', $config->get( 'config_language_id' ) ); } else { echo 'Add to wishlist'; } ?></a>
  478.                         <a onclick="compare.add('<?php echo $product_id; ?>');"><?php if($theme_options->get( 'add_to_compare_text', $config->get( 'config_language_id' ) ) != '') { echo $theme_options->get( 'add_to_compare_text', $config->get( 'config_language_id' ) ); } else { echo 'Add to compare'; } ?></a>
  479.                     </div>
  480.                      
  481.                     <?php if ($minimum > 1) { ?>
  482.                     <div class="minimum"><?php echo $text_minimum; ?></div>
  483.                     <?php } ?>
  484.                   </div>
  485.                  </div><!-- End #product -->
  486.                  
  487.                   <?php
  488.                   $product_options_bottom = $modules_old_opencart->getModules('product_options_bottom');
  489.                   if( count($product_options_bottom) ) {
  490.                     foreach ($product_options_bottom as $module) {
  491.                         echo $module;
  492.                     }
  493.                   } ?>
  494.                 </div>
  495.             </div>
  496.         </div>
  497.        
  498.         <?php if($theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'status' ) == 1 || count($product_custom_block)) { ?>
  499.         <div class="col-md-3 col-sm-12">
  500.              <?php if($theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'status' ) == 1) { ?>
  501.             <div class="product-block">
  502.                 <?php if($theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'heading' ) != '') { ?>
  503.                 <h4 class="title-block"><?php echo $theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'heading' ); ?></h4>
  504.                 <div class="strip-line"></div>
  505.                 <?php } ?>
  506.                 <div class="block-content">
  507.                     <?php echo html_entity_decode($theme_options->get( 'custom_block', 'product_page', $config->get( 'config_language_id' ), 'text' )); ?>
  508.                 </div>
  509.             </div>
  510.             <?php } ?>
  511.            
  512.             <?php foreach ($product_custom_block as $module) { echo $module; } ?>
  513.         </div>
  514.         <?php } ?>
  515.     </div>
  516.   </div>
  517.  
  518.   <?php
  519.   $product_over_tabs = $modules_old_opencart->getModules('product_over_tabs');
  520.   if( count($product_over_tabs) ) {
  521.     foreach ($product_over_tabs as $module) {
  522.         echo $module;
  523.     }
  524.   } ?>
  525.  
  526.   <?php
  527.       $language_id = $config->get( 'config_language_id' );
  528.       $tabs = array();
  529.      
  530.       $tabs[] = array(
  531.         'heading' => $tab_description,
  532.         'content' => 'description',
  533.         'sort' => 1
  534.       );
  535.      
  536.       if ($attribute_groups) {
  537.           $tabs[] = array(
  538.             'heading' => $tab_attribute,
  539.             'content' => 'attribute',
  540.             'sort' => 3
  541.           );
  542.       }
  543.      
  544.       if ($review_status) {
  545.           $tabs[] = array(
  546.             'heading' => $tab_review,
  547.             'content' => 'review',
  548.             'sort' => 5
  549.           );
  550.       }
  551.              
  552.       if(is_array($config->get('product_tabs'))) {
  553.           foreach($config->get('product_tabs') as $tab) {
  554.             if($tab['status'] == 1 || $tab['product_id'] == $product_id) {
  555.                 foreach($tab['tabs'] as $zakladka) {
  556.                     if($zakladka['status'] == 1) {
  557.                         $heading = false; $content = false;
  558.                         if(isset($zakladka[$language_id])) {
  559.                             $heading = $zakladka[$language_id]['name'];
  560.                             $content = html_entity_decode($zakladka[$language_id]['html']);
  561.                         }
  562.                         $tabs[] = array(
  563.                             'heading' => $heading,
  564.                             'content' => $content,
  565.                             'sort' => $zakladka['sort_order']
  566.                         );
  567.                     }
  568.                 }
  569.             }
  570.           }
  571.       }
  572.      
  573.       usort($tabs, "cmp_by_optionNumber");
  574.   ?>
  575.   <div id="tabs" class="htabs">
  576.     <?php $i = 0; foreach($tabs as $tab) { $i++;
  577.         $id = 'tab_'.$i;
  578.         if($tab['content'] == 'description') { $id = 'tab-description'; }
  579.         if($tab['content'] == 'attribute') { $id = 'tab-attribute'; }
  580.         if($tab['content'] == 'review') { $id = 'tab-review'; }
  581.         echo '<a href="#'.$id.'">'.$tab['heading'].'</a>';
  582.     } ?>
  583.   </div>
  584.   <?php $i = 0; foreach($tabs as $tab) { $i++;
  585.     $id = 'tab_'.$i;
  586.     if($tab['content'] != 'description' && $tab['content'] != 'attribute' && $tab['content'] != 'review') {
  587.         echo '<div id="'.$id.'" class="tab-content">'.$tab['content'].'</div>';
  588.     }
  589.   } ?>
  590.   <div id="tab-description" class="tab-content" itemprop="description"><?php echo $description; ?></div>
  591.   <?php if ($attribute_groups) { ?>
  592.   <div id="tab-attribute" class="tab-content">
  593.     <table class="attribute" cellspacing="0">
  594.       <?php foreach ($attribute_groups as $attribute_group) { ?>
  595.       <thead>
  596.         <tr>
  597.           <td colspan="2"><?php echo $attribute_group['name']; ?></td>
  598.         </tr>
  599.       </thead>
  600.       <tbody>
  601.         <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
  602.         <tr>
  603.           <td><?php echo $attribute['name']; ?></td>
  604.           <td><?php echo $attribute['text']; ?></td>
  605.         </tr>
  606.         <?php } ?>
  607.       </tbody>
  608.       <?php } ?>
  609.     </table>
  610.   </div>
  611.   <?php } ?>
  612.   <?php if ($review_status) { ?>
  613.   <div id="tab-review" class="tab-content">
  614.     <form class="form-horizontal" id="form-review">
  615.       <div id="review"></div>
  616.       <h2><?php echo $text_write; ?></h2>
  617.       <?php if ($review_guest) { ?>
  618.       <div class="form-group required">
  619.         <div class="col-sm-12">
  620.           <label class="control-label" for="input-name"><?php echo $entry_name; ?></label>
  621.           <input type="text" name="name" value="" id="input-name" class="form-control" />
  622.         </div>
  623.       </div>
  624.       <div class="form-group required">
  625.         <div class="col-sm-12">
  626.              <label class="control-label"><?php echo $entry_rating; ?></label>
  627.            
  628.            <div class="rating set-rating">
  629.               <i class="fa fa-star" data-value="1"></i>
  630.               <i class="fa fa-star" data-value="2"></i>
  631.               <i class="fa fa-star" data-value="3"></i>
  632.               <i class="fa fa-star" data-value="4"></i>
  633.               <i class="fa fa-star" data-value="5"></i>
  634.           </div>
  635.           <script type="text/javascript">
  636.               $(document).ready(function() {
  637.                 $('.set-rating i').hover(function(){
  638.                     var rate = $(this).data('value');
  639.                     var i = 0;
  640.                     $('.set-rating i').each(function(){
  641.                         i++;
  642.                         if(i <= rate){
  643.                             $(this).addClass('active');
  644.                         }else{
  645.                             $(this).removeClass('active');
  646.                         }
  647.                     })
  648.                 })
  649.                
  650.                 $('.set-rating i').mouseleave(function(){
  651.                     var rate = $('input[name="rating"]:checked').val();
  652.                     rate = parseInt(rate);
  653.                     i = 0;
  654.                       $('.set-rating i').each(function(){
  655.                         i++;
  656.                         if(i <= rate){
  657.                             $(this).addClass('active');
  658.                         }else{
  659.                             $(this).removeClass('active');
  660.                         }
  661.                       })
  662.                 })
  663.                
  664.                 $('.set-rating i').click(function(){
  665.                     $('input[name="rating"]:nth('+ ($(this).data('value')-1) +')').prop('checked', true);
  666.                 });
  667.               });
  668.           </script>
  669.           <div class="hidden">
  670.              &nbsp;&nbsp;&nbsp; <?php echo $entry_bad; ?>&nbsp;
  671.              <input type="radio" name="rating" value="1" />
  672.              &nbsp;
  673.              <input type="radio" name="rating" value="2" />
  674.              &nbsp;
  675.              <input type="radio" name="rating" value="3" />
  676.              &nbsp;
  677.              <input type="radio" name="rating" value="4" />
  678.              &nbsp;
  679.              <input type="radio" name="rating" value="5" />
  680.              &nbsp;<?php echo $entry_good; ?>
  681.           </div>
  682.        </div>
  683.       </div>
  684.       <div class="form-group required">
  685.         <div class="col-sm-12">
  686.           <label class="control-label" for="input-review"><?php echo $entry_review; ?></label>
  687.           <textarea name="text" rows="5" id="input-review" class="form-control"></textarea>
  688.           <div class="help-block"><?php echo $text_note; ?></div>
  689.         </div>
  690.       </div>
  691.       <?php echo $captcha; ?>
  692.       <div class="buttons clearfix" style="margin-bottom: 0px">
  693.         <div class="pull-right">
  694.           <button type="button" id="button-review" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary"><?php echo $button_continue; ?></button>
  695.         </div>
  696.       </div>
  697.       <?php } else { ?>
  698.       <?php echo $text_login; ?>
  699.       <?php } ?>
  700.     </form>
  701.   </div>
  702.   <?php } ?>
  703.   <?php if ($tags) { ?>
  704.   <div class="tags_product"><b><?php echo $text_tags; ?></b>
  705.     <?php for ($i = 0; $i < count($tags); $i++) { ?>
  706.     <?php if ($i < (count($tags) - 1)) { ?>
  707.     <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>,
  708.     <?php } else { ?>
  709.     <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>
  710.     <?php } ?>
  711.     <?php } ?>
  712.   </div>
  713.   <?php } ?>
  714.  
  715. </div>
  716.  
  717. <script type="text/javascript"><!--
  718. $('select[name=\'recurring_id\'], input[name="quantity"]').change(function(){
  719.     $.ajax({
  720.         url: 'index.php?route=product/product/getRecurringDescription',
  721.         type: 'post',
  722.         data: $('input[name=\'product_id\'], input[name=\'quantity\'], select[name=\'recurring_id\']'),
  723.         dataType: 'json',
  724.         beforeSend: function() {
  725.             $('#recurring-description').html('');
  726.         },
  727.         success: function(json) {
  728.             $('.alert, .text-danger').remove();
  729.            
  730.             if (json['success']) {
  731.                 $('#recurring-description').html(json['success']);
  732.             }
  733.         }
  734.     });
  735. });
  736. //--></script>
  737. <script type="text/javascript"><!--
  738. $('#button-cart').on('click', function() {
  739.     $.ajax({
  740.         url: 'index.php?route=checkout/cart/add',
  741.         type: 'post',
  742.         data: $('#product input[type=\'text\'], #product input[type=\'hidden\'], #product input[type=\'radio\']:checked, #product input[type=\'checkbox\']:checked, #product select, #product textarea'),
  743.         dataType: 'json',
  744.         beforeSend: function() {
  745.             $('#button-cart').button('loading');
  746.         },
  747.         complete: function() {
  748.             $('#button-cart').button('reset');
  749.         },
  750.         success: function(json) {
  751.             $('.alert, .text-danger').remove();
  752.             $('.form-group').removeClass('has-error');
  753.  
  754.             if (json['error']) {
  755.                 if (json['error']['option']) {
  756.                     for (i in json['error']['option']) {
  757.                         var element = $('#input-option' + i.replace('_', '-'));
  758.                        
  759.                         if (element.parent().hasClass('input-group')) {
  760.                             element.parent().after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
  761.                         } else {
  762.                             element.after('<div class="text-danger">' + json['error']['option'][i] + '</div>');
  763.                         }
  764.                     }
  765.                 }
  766.                
  767.                 if (json['error']['recurring']) {
  768.                     $('select[name=\'recurring_id\']').after('<div class="text-danger">' + json['error']['recurring'] + '</div>');
  769.                 }
  770.                
  771.                 // Highlight any found errors
  772.                 $('.text-danger').parent().addClass('has-error');
  773.             }
  774.            
  775.             if (json['success']) {
  776.                 $.notify({
  777.                     message: json['success'],
  778.                     target: '_blank'
  779.                 },{
  780.                     // settings
  781.                     element: 'body',
  782.                     position: null,
  783.                     type: "info",
  784.                     allow_dismiss: true,
  785.                     newest_on_top: false,
  786.                     placement: {
  787.                         from: "top",
  788.                         align: "right"
  789.                     },
  790.                     offset: 20,
  791.                     spacing: 10,
  792.                     z_index: 2031,
  793.                     delay: 5000,
  794.                     timer: 1000,
  795.                     url_target: '_blank',
  796.                     mouse_over: null,
  797.                     animate: {
  798.                         enter: 'animated fadeInDown',
  799.                         exit: 'animated fadeOutUp'
  800.                     },
  801.                     onShow: null,
  802.                     onShown: null,
  803.                     onClose: null,
  804.                     onClosed: null,
  805.                     icon_type: 'class',
  806.                     template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' +
  807.                         '<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>' +
  808.                         '<span data-notify="message"><i class="fa fa-check-circle"></i>&nbsp; {2}</span>' +
  809.                         '<div class="progress" data-notify="progressbar">' +
  810.                             '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
  811.                         '</div>' +
  812.                         '<a href="{3}" target="{4}" data-notify="url"></a>' +
  813.                     '</div>'
  814.                 });
  815.                
  816.                 $('#cart_block #cart_content').load('index.php?route=common/cart/info #cart_content_ajax');
  817.                 $('#cart_block #total_price_ajax').load('index.php?route=common/cart/info #total_price');
  818.                 $('#cart_block .cart-count').load('index.php?route=common/cart/info #total_count_ajax');
  819.             }
  820.         },
  821.         error: function(xhr, ajaxOptions, thrownError) {
  822.             alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
  823.         }
  824.     });
  825. });
  826. //--></script>
  827. <script type="text/javascript"><!--
  828. $('.date').datetimepicker({
  829.     pickTime: false
  830. });
  831.  
  832. $('.datetime').datetimepicker({
  833.     pickDate: true,
  834.     pickTime: true
  835. });
  836.  
  837. $('.time').datetimepicker({
  838.     pickDate: false
  839. });
  840.        
  841. $('button[id^=\'button-upload\']').on('click', function() {
  842.     var node = this;
  843.    
  844.     $('#form-upload').remove();
  845.    
  846.     $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');
  847.    
  848.     $('#form-upload input[name=\'file\']').trigger('click');
  849.    
  850.     timer = setInterval(function() {
  851.         if ($('#form-upload input[name=\'file\']').val() != '') {
  852.             clearInterval(timer);
  853.            
  854.             $.ajax({
  855.                 url: 'index.php?route=tool/upload',
  856.                 type: 'post',
  857.                 dataType: 'json',
  858.                 data: new FormData($('#form-upload')[0]),
  859.                 cache: false,
  860.                 contentType: false,
  861.                 processData: false,
  862.                 beforeSend: function() {
  863.                     $(node).button('loading');
  864.                 },
  865.                 complete: function() {
  866.                     $(node).button('reset');
  867.                 },
  868.                 success: function(json) {
  869.                     $('.text-danger').remove();
  870.                    
  871.                     if (json['error']) {
  872.                         $(node).parent().find('input').after('<div class="text-danger">' + json['error'] + '</div>');
  873.                     }
  874.                    
  875.                     if (json['success']) {
  876.                         alert(json['success']);
  877.                        
  878.                         $(node).parent().find('input').attr('value', json['code']);
  879.                     }
  880.                 },
  881.                 error: function(xhr, ajaxOptions, thrownError) {
  882.                     alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
  883.                 }
  884.             });
  885.         }
  886.     }, 500);
  887. });
  888. //--></script>
  889. <script type="text/javascript"><!--
  890. $('#review').delegate('.pagination a', 'click', function(e) {
  891.     e.preventDefault();
  892.    
  893.     $('#review').fadeOut('slow');
  894.        
  895.     $('#review').load(this.href);
  896.    
  897.     $('#review').fadeIn('slow');
  898. });        
  899.  
  900. $('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');
  901.  
  902. $('#button-review').on('click', function() {
  903.     $.ajax({
  904.         url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
  905.         type: 'post',
  906.         dataType: 'json',
  907.         data: $("#form-review").serialize(),
  908.         beforeSend: function() {
  909.             $('#button-review').button('loading');
  910.         },
  911.         complete: function() {
  912.             $('#button-review').button('reset');
  913.         },
  914.         success: function(json) {
  915.             $('.alert-success, .alert-danger').remove();
  916.            
  917.             if (json['error']) {
  918.                 $('#review').after('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
  919.             }
  920.            
  921.             if (json['success']) {
  922.                 $('#review').after('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
  923.                                
  924.                 $('input[name=\'name\']').val('');
  925.                 $('textarea[name=\'text\']').val('');
  926.                 $('input[name=\'rating\']:checked').prop('checked', false);
  927.             }
  928.         }
  929.     });
  930. });
  931. </script>
  932.  
  933. <script type="text/javascript"><!--
  934. $(document).ready(function() {    
  935.     $('.popup-gallery').magnificPopup({
  936.         delegate: 'a.popup-image',
  937.         type: 'image',
  938.         tLoading: 'Loading image #%curr%...',
  939.         mainClass: 'mfp-with-zoom',
  940.         removalDelay: 200,
  941.         gallery: {
  942.             enabled: true,
  943.             navigateByImgClick: true,
  944.             preload: [0,1] // Will preload 0 - before current, and 1 after the current image
  945.         },
  946.         image: {
  947.             tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
  948.             titleSrc: function(item) {
  949.                 return item.el.attr('title');
  950.             }
  951.         }
  952.     });
  953. });
  954. //--></script>
  955.  
  956. <script type="text/javascript">
  957. var ajax_price = function() {
  958.     $.ajax({
  959.         type: 'POST',
  960.         url: 'index.php?route=product/liveprice/index',
  961.         data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
  962.         dataType: 'json',
  963.             success: function(json) {
  964.             if (json.success) {
  965.                 change_price('#price-special', json.new_price.special);
  966.                 change_price('#price-tax', json.new_price.tax);
  967.                 change_price('#price-old', json.new_price.price);
  968.             }
  969.         }
  970.     });
  971. }
  972.  
  973. var change_price = function(id, new_price) {
  974.     $(id).html(new_price);
  975. }
  976.  
  977. $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\'], .product-info input[type=\'checkbox\'], .product-info select, .product-info textarea, .product-info input[name=\'quantity\']').on('change', function() {
  978.     ajax_price();
  979. });
  980. </script>
  981.  
  982. <script type="text/javascript">
  983. $.fn.tabs = function() {
  984.     var selector = this;
  985.    
  986.     this.each(function() {
  987.         var obj = $(this);
  988.        
  989.         $(obj.attr('href')).hide();
  990.        
  991.         $(obj).click(function() {
  992.             $(selector).removeClass('selected');
  993.            
  994.             $(selector).each(function(i, element) {
  995.                 $($(element).attr('href')).hide();
  996.             });
  997.            
  998.             $(this).addClass('selected');
  999.            
  1000.             $($(this).attr('href')).show();
  1001.            
  1002.             return false;
  1003.         });
  1004.     });
  1005.  
  1006.     $(this).show();
  1007.    
  1008.     $(this).first().click();
  1009. };
  1010. </script>
  1011.  
  1012. <script type="text/javascript"><!--
  1013. $('#tabs a').tabs();
  1014. //--></script>
  1015.  
  1016. <?php if($theme_options->get( 'product_image_zoom' ) != 2) {
  1017. echo '<script type="text/javascript" src="catalog/view/theme/' . $config->get('theme_' . $config->get('config_theme') . '_directory') . '/js/jquery.elevateZoom-3.0.3.min.js"></script>';
  1018. } ?>
  1019.  
  1020. <?php include('catalog/view/theme/'.$config->get('theme_' . $config->get('config_theme') . '_directory').'/template/new_elements/wrapper_bottom.tpl'); ?>
  1021. <?php echo $footer; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement