Jump to content
turbotrade

перенести часть дизайна в модуль рекомендуемые и акции

Recommended Posts

Здравствуйте, форумчани! прошу подсказать куда смотреть и какой кусок кода переносить что бы отобразать верно две вещи

1.Страница акции проблема стикера и кнопки купить. В каталоге и по поиску товар доступен и горит стикер акция https://prnt.sc/mlxmpl , на самой странице такого нету, и второе это отсутствие атрибутов яркости и температуры под картинкой https://prnt.sc/mlxme1 на странице акций которая выведена дефолтным модулем через схему

2. Так же отсутствие атрибутов на модуле рекомендуемые который отображ через схему на главной странице, опять же под картинкой нету значений https://prnt.sc/mlxnqw хотя в коде эти блоки есть но заполненности нету, просто div пустой 

Что откуда надо скопировать подтянуть для корректной работы что в каталоге товаров что в модулей

Заранее благодарю за ответы

ocStore 2.3.0.2.3

Share this post


Link to post
Share on other sites
9 минут назад, turbotrade сказал:

отсутствие атрибутов яркости и температуры под картинкой https://prnt.sc/mlxme1 на странице акций которая выведена дефолтным модулем ч

 

9 минут назад, turbotrade сказал:

Так же отсутствие атрибутов на модуле рекомендуемые который отображ через схему на главной странице,

из коробки, атрибуты не выводятся

 

Share this post


Link to post
Share on other sites

согласен, но есть модули где уже настроен вывод, вот и прошу помочь подсказать какой кусок кода с какого файла или папки брать

Share this post


Link to post
Share on other sites
35 минут назад, turbotrade сказал:

но есть модули где уже настроен вывод,

вы думаете,  что от сюда видно, как там у вас выводятся атрибуты.?

Share this post


Link to post
Share on other sites
<?php echo $header; ?>
<div class="container">
  <ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a itemscope itemtype="http://schema.org/Thing"
     itemprop="item" href="<?php echo $breadcrumb['href']; ?>"><span itemprop="name"><?php echo $breadcrumb['text']; ?></span></a></li>
     <?php } ?>
   </ul>
   <h1 class="account_title"><?php echo $heading_title; ?></h1>
   <div class="row"><?php echo $column_left; ?>

     <div id="content">
       <?php echo $content_top; ?>

       <?php if ($products) { ?>
       <div class="row categiry_header">
        <div class="categiry_header_result"><?php echo $results; ?></div>

        <div class="categiry_header_left">
          <div class="btn-group">
            <button type="button" id="grid-view" class="btn btn-view" title="<?php echo $button_grid; ?>"></button>
            <button type="button" id="list-view" class="btn btn-view" title="<?php echo $button_list; ?>"></button>
          </div>
        </div>
      </div>

      <div>
        <div class="row prosuct_hide_dop_attr category_page">
          <?php $count_prod = 0; foreach ($products as $product) { ?>
          <div class="product-layout product-list" itemscope itemtype="http://schema.org/Product">
            <div class="product-thumb transition">
              <ul class="product_lables">
                <?php if ($product['special']) { ?>
                <li><span class="label_action"><?php echo $action_product_label_text; ?></span></li>
                <?php } ?>
                <?php if($product['orders'] > 10){ ?>
                <li><span class="label_hit"><?php echo $bestseller_label_text; ?></span></li>
                <?php } ?>
                <?php if($product['quantity'] <= 0 ){ ?>
                <li><span class="label_not_available"><?php echo $not_available_label_text; ?></span></li>
                <?php } ?>
              </ul>
              <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" class="img-responsive" /></a></div>
              <div class="caption">
                <div class="attribut_block">
                  <?php if ($product['attr']) { ?>
                  <?php
                  $os = array(
                  "Світловий потік" =>"/catalog/view/theme/feron/image/potok.svg", 
                  "Световой поток" =>"/catalog/view/theme/feron/image/potok.svg", 
                  "Світлова температура" =>"/catalog/view/theme/feron/image/temp_svet.svg",
                  "Цветовая температура" =>"/catalog/view/theme/feron/image/temp_svet.svg",
                  "Цоколь" =>"/catalog/view/theme/feron/image/cokol.svg"
                  );
                  if (!empty($product['attr'])) {
                  $attr_else = array();
                  echo "<ul class='attribute'>";
                    foreach ($product['attr'] as $attr) {
                    if (array_key_exists($attr['name'], $os)) {
                    echo "<li class='attribute_item' data-tooltip='".$attr['name']."'><div class='attribute_item_wrap'>";
                      echo "<div class='attribute_item_wrap_img'><img src='".$os[$attr['name']]."' alt='".$attr['text']."'></div>";
                      echo "<span>".$attr['text']."</span>";
                    echo "</div></li>";
                  }else{
                  $attr_else[] = $attr;
                }
              }
            }
          echo "</ul>";
          ?>
          <?php } ?>
        </div>
        <h4 itemprop="Name"><a href="<?php echo $product['href']; ?>" class="product_title"><?php echo $product['name']; ?></a></h4>

        <div itemtype="http://schema.org/AggregateOffer" itemscope="" itemprop="offers">
          <meta content="<?php echo $product['quantity']; ?>" itemprop="offerCount">
          <meta content="<?php echo $currency_price; ?>" itemprop="highPrice">
          <meta content="<?php echo $currency_price; ?>" itemprop="lowPrice">
          <meta content="<?php echo $currency; ?>" itemprop="priceCurrency">
        </div>
        <ul class="compare_block">
          <li>
            <button type="button" title="<?php echo $button_compare; ?>" onclick="compare.add('<?php echo $product['product_id']; ?>');"><i class="ico_compare"></i></button>
          </li>
          <li>
            <?php if(!$registered_user){ ?>
            <a href="#quick-login" class="quick_signup like_product_block">
              <i class="ico_like"></i> <span><?php echo $product['likes']; ?></span>
            </a>
         <?php }else{ ?>
         <div class="like_product_block" data-product_id="<?php echo $product['product_id']; ?>">
          <svg version="1.1" class="like_product <?php echo !$product['user_like_this'] ? 'js_like_product' : 'js_delite_like_product'; ?>" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
            viewBox="0 0 182.4 157.3" xml:space="preserve">
            <g>
             <path d="M130.9,6c-17.1,0-31.9,6.9-39.7,20.9C83.4,12.9,68.6,6,51.5,6C23.2,6,4.4,26.4,6.1,51.4
             c2.4,36.1,85.1,100,85.1,100s82.7-63.1,85.1-100C177.9,26.4,159.2,6,130.9,6z"/>
             <path d="M82.1,41.6c0,0,7.1-11.8,9-14.7"/>
             <path d="M133.5,26.9c0,0,21.3,4.6,21.3,23.8"/>
           </g>
         </svg>
         <span><?php echo $product['likes']; ?></span>
       </div>
       <?php } ?>
     </li>
   </ul>
 </div>
 <div class="button-group ">
  <div class="price_reward_block">
    <?php if ($product['price']) { ?>
    <p class="price_text--list"><?php echo $text_price; ?>:</p>
    <p class="price">
      <?php if (!$product['special']) { ?>
      <?php echo $product['price']; ?>
      <?php } else { ?>
      <span class="price-new"><?php echo $product['special']; ?></span>
      <?php } ?>
      <?php if ($product['tax']) { ?>
      <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
      <?php } ?>
    </p>
    <?php } ?>
    <?php if($product['reward']){ ?>
    <div class="reward_block">
      <p class="reward_block-text">+<?php echo $product['reward']; ?> бонус</p>
    </div>
    <?php } ?>
  </div>
  <?php $disabled = $product['quantity'] <= 0 ? "disabled":""; ?>
  <button type="button" data-pdqo-item="<?php echo $product['product_id']; ?>" onclick="pdqoObject(this);dataLayer.push({
'eventCategory':'Buy_Button', 
'eventAction':'Click', 
'virtualUrl':'/funnel/Buy_Button', 
'event':'UAevent' 
});" class="btn btn_buy <?php echo $disabled; ?>" <?php echo $disabled; ?>><span><?php echo $button_cart; ?></span></button>
  <!--                     <button type="button" onclick="cart.add('<?php echo $product['product_id']; ?>');" class="btn btn_buy <?php echo $disabled; ?>" <?php echo $disabled; ?>><span><?php echo $button_cart; ?></span></button> -->
</div>
<div class="product_dop_attr">
  <?php if(isset($attr_else)){
  echo "<ul class='product_dop_attribute'>";
    $attr_count = 0;
    foreach ($attr_else as $attr) {
    if($attr_count < 4){
    echo "<li class='product_dop_attribute_item'><span class='product_dop_attribute_item_name'>". $attr['name'].":</span> ".$attr['text']. "</li>";
    $attr_count++;
  }else{
  continue;
}
}
echo "</ul>";
} ?>
</div>
</div>
</div>
<?php $count_prod++; } ?>
</div>
<div class="row row_loadmorearticles">
  <?php if($has_pages){ ?>
  <div class="loadmorearticles"><i class="ajax_load"></i><?php echo $text_read_mode_ajax; ?></div>
  <?php } ?>
</div>

</div>
<?php } ?>

<?php if (!$products) { ?>
<div class="not_found_block tac">
  <p class="not_found_text"><?php echo $text_empty; ?></p>
  <div class="buttons">
    <div class="pull-right"><a href="<?php echo $continue; ?>" class="btn btn-primary"><?php echo $button_continue; ?></a></div>
  </div>
</div>
<?php } ?>

</div>
</div>

<div class="row category_dop_prod">
  <div class="category_dop_prod_slider">
    <?php echo $content_bottom; ?>
  </div>
</div>


</div>



<script>
  jQuery(document).ready(function($) {
    $('.quantity_minus').click(function(event) {
      quantityRes("difference",$(this).next(".quantity"));
    });
    $('.quantity_pluse').click(function(event) {
      quantityRes("amount",$(this).prev(".quantity"));
    });
  });
  function quantityRes(act,val){
      // console.log(val);
      var value = parseInt(val.val());
      if(act == "difference" && value > 1){
        val.val(value-1);
      }else if(act == "amount"){
        val.val(value+1);
      }
    }
  </script>


  <link href="/catalog/view/javascript/select2/select2.min.css" rel="stylesheet" />
  <script src="/catalog/view/javascript/select2/select2.min.js"></script>

  <script>
    jQuery(document).ready(function($) {
     $('select').select2({
      minimumResultsForSearch: Infinity
    });
   });
 </script>


 <script>
  jQuery(document).ready(function($) {

    var page = 1;
    $(".loadmorearticles").click(function(event) {
      page++;
      $.ajax({
        url: 'index.php?route=product/new/ajaxLoadProducts',
        type: 'GET',
        dataType: 'json',
        data: {page: page, url: window.location.href},
      })
      .done(function(json) {
        console.log("success");

        if(json['success'] == true){
          var count_prod = 0;
          $('.ajax_load').addClass('animate');
          setTimeout(function () {
            $.each(json['products'], function(index, product) {
              var product_html = '';

              product_html += '<div class="product-layout product-'+localStorage.getItem('display')+'" itemscope itemtype="http://schema.org/Product">'+
              '<div class="product-thumb transition">';

              if(Date.parse(product['date_added']) < 60*60*24*31 || product['orders'] > 10 || product['special']){
                product_html += '<ul class="product_lables">';
                if (product['special']) {
                  product_html += '<li><span class="label_action"><?php echo $action_product_label_text; ?></span></li>';
                }
                if(product['orders'] > 10){
                  product_html += '<li><span class="label_hit"><?php echo $bestseller_label_text; ?></span></li>';
                }
                if(product['quantity'] <= 0){
                  product_html += '<li><span class="label_not_available"><?php echo $not_available_label_text; ?></span></li>';
                }
                product_html += '</ul>';
              }


              product_html += '<div class="image"><a href="'+product["href"]+'"><img src="'+product["thumb"]+'" alt="'+product["name"]+'" title="'+product["name"]+'" class="img-responsive" /></a></div>'+
              '<div class="caption"><div class="attribut_block">';


              if(product['attr']){
                var attr_else = new Array();

                var os = {
                  "Світловий потік" :"/catalog/view/theme/feron/image/potok.svg", 
                  "Световой поток" :"/catalog/view/theme/feron/image/potok.svg", 
                  "Світлова температура" :"/catalog/view/theme/feron/image/temp_svet.svg",
                  "Цветовая температура" :"/catalog/view/theme/feron/image/temp_svet.svg",
                  "Цоколь" :"/catalog/view/theme/feron/image/cokol.svg"
                }
                product_html += '<ul class="attribute">';
                $.each(os, function(index, val) {
                  $.each(product['attr'], function(attr_index, attr_val) {
                    if(index == attr_val['name']){
                      product_html += '<li class="attribute_item" data-tooltip="'+attr_val["name"]+'"><img src="'+val+'" alt="'+attr_val["text"]+'">'+attr_val["text"]+'</li>'; 
                    }else{
                      attr_else.push(attr_val);
                    }

                  });
                });
                product_html += '</ul>'; 
              }

              product_html += '</div><h4 itemprop="Name"><a href="'+product["href"]+'" class="product_title">'+product["name"]+'</a></h4>'+
              '<div itemtype="http://schema.org/AggregateOffer" itemscope="" itemprop="offers"><meta content="'+product["quantity"]+'" itemprop="offerCount"><meta content="'+product["currency_price"]+'" itemprop="highPrice"><meta content="'+product["currency_price"]+'" itemprop="lowPrice"><meta content="'+product["currency"]+'" itemprop="priceCurrency"></div>'+
              '<ul class="compare_block">';

              // if(product["youtube"] != ""){
              //   product_html += '<li><img src="/catalog/view/theme/feron/image/youtube.png" alt="Есть видео">';
              // }
              product_html += '<li><button type="button" title="<?php echo $button_compare; ?>" onclick="compare.add('+product["product_id"]+');">              <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 322.7 269.7" style="enable-background:new 0 0 322.7 269.7;" xml:space="preserve" class="compare_svg"><g><path class="st0" d="M169.2,39c17.3,0,31.4,14.1,31.4,31.4c0,2.7-0.4,5.5-1,8.1"/><path class="st0" d="M138.2,64.9c-0.3,1.7-0.4,3.6-0.4,5.5c0,17.3,14.1,31.4,31.4,31.4c14.5,0,26.8-9.9,30.4-23.3"/><path class="st0" d="M138.2,64.9c2.6-14.7,15.4-25.9,31-25.9"/><line class="st0" x1="169.2" y1="39" x2="169.2" y2="6"/><path class="st0" d="M199.6,78.5"/><path class="st0" d="M138.2,64.9"/><line class="st0" x1="267.7" y1="93.6" x2="199.6" y2="78.5"/><line class="st0" x1="138.2" y1="64.9" x2="54.8" y2="46.5"/><g><line class="st0" x1="54.8" y1="46.5" x2="103.8" y2="182.2"/><line class="st0" x1="54.8" y1="46.5" x2="6" y2="182.2"/><line class="st0" x1="6" y1="182.2" x2="103.8" y2="182.2"/><path class="st0" d="M6,182.2c0,19,21.9,34.4,49,34.4s49-15.4,49-34.4"/></g><g><line class="st0" x1="267.7" y1="93.6" x2="316.7" y2="229.3"/><line class="st0" x1="267.7" y1="93.6" x2="218.9" y2="229.3"/><line class="st0" x1="316.7" y1="229.3" x2="218.9" y2="229.3"/><path class="st0" d="M316.7,229.3c0,19-21.9,34.4-49,34.4c-27.1,0-49-15.4-49-34.4"/></g></g></svg></button></li>';


              if(!json['registered_user']){
                product_html += '<li><a href="#quick-login" class="quick_signup like_product_block"><svg version="1.1" class="like_product" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 182.4 157.3" xml:space="preserve"><g><path d="M130.9,6c-17.1,0-31.9,6.9-39.7,20.9C83.4,12.9,68.6,6,51.5,6C23.2,6,4.4,26.4,6.1,51.4,c2.4,36.1,85.1,100,85.1,100s82.7-63.1,85.1-100C177.9,26.4,159.2,6,130.9,6z"/><path d="M82.1,41.6c0,0,7.1-11.8,9-14.7"/><path d="M133.5,26.9c0,0,21.3,4.6,21.3,23.8"/></g></svg><span>'+product["likes"]+'</span></a></li>'
              }else{
                var user_like_this = !product["user_like_this"] ? "js_like_product" : "js_delite_like_product";
                product_html += '<li><div class="like_product_block" data-product_id="'+product["product_id"]+'"><svg version="1.1" class="like_product '+user_like_this+'" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 182.4 157.3" xml:space="preserve"><g><path d="M130.9,6c-17.1,0-31.9,6.9-39.7,20.9C83.4,12.9,68.6,6,51.5,6C23.2,6,4.4,26.4,6.1,51.4,c2.4,36.1,85.1,100,85.1,100s82.7-63.1,85.1-100C177.9,26.4,159.2,6,130.9,6z"/><path d="M82.1,41.6c0,0,7.1-11.8,9-14.7"/><path d="M133.5,26.9c0,0,21.3,4.6,21.3,23.8"/></g></svg><span>'+product['likes']+'</span></div></li>';
              }

              product_html += '</ul></div>';

              product_html +='<div class="button-group "><div>';

              if(product["price"] != "" && !product["special"]){
                product_html += '<p class="price">'+product["price"]+'</p>';
              }else if(product["special"]){
                product_html += '<p class="price">'+product["special"]+'</p>';
              }
              if(product["reward"] != null){
                product_html += '<div class="reward_block"><p class="reward_block-text">+' + product["reward"] + ' бонус</p></div>';
              }
              var disabled = product['quantity'] <= 0 ? "disabled":"";

              product_html +='</div><button type="button" data-pdqo-item="'+product["product_id"]+'" onclick="pdqoObject(this);" class="btn btn_buy '+disabled+'" '+disabled+'><span>'+json["button_cart"]+'</span></button></div>';


              product_html +='</div></div>';

              $(".category_page").append(product_html);
              count_prod++;
            });
}, 200);
}else if(json['success'] == false){
  $(".loadmorearticles").remove();
}
})
.fail(function() {
  console.log("error");
})
.always(function() {
  console.log("complete");
  setTimeout(function () {
    $('.ajax_load').removeClass('animate');
  }, 400);

});

});

});

jQuery(document).ready(function($) {
  if($(window).width() < 769){
    $(".ocfilter_header_tablet").next('.ocfilter').slideUp(100);
  }
  $(".ocfilter_header_tablet").click(function(event) {
    $(this).next('.ocfilter').slideToggle(400);
  });
});
</script>
<?php echo $footer; ?>
<?php
class ControllerProductNew extends Controller {
    private $type = 'module';
    private $name = 'new';

    public function index() {
        $this->load->model('catalog/product');
        $this->load->model('tool/image');

        if (file_exists(DIR_APPLICATION.'controller/extension/module/anystore.php')) {
            include (DIR_APPLICATION.'controller/extension/module/anystore.php');
        }

        $this->load->language('product/new');
        $this->load->model('extension/'.$this->type);

        $module_info = $this->model_extension_module->getModuleByCode($this->name);
      //  print_r($module_info);

        if (is_array($module_info)) {
            $sort = $module_info['sort'];
            $day_limit = $module_info['day_limit'];
            $product_limit = $module_info['product_limit'];
        }
        else {
            $sort = $module_info->sort;
            $day_limit = $module_info->day_limit;
            $product_limit = $module_info->product_limit;
        }


        $order = 'DESC';

        if (!$sort) {
            $sort = 'date_added';
        }


        if (isset($this->request->get['page'])) {
            $page = $this->request->get['page'];
        }
        else {
            $page = 1;
        }

        if (isset($this->request->get['limit'])) {
            $limit = (int)$this->request->get['limit'];
        } else {
            $limit = $this->config->get($this->config->get('config_theme') . '_product_limit');
        }

        $this->document->setTitle($this->language->get('heading_title'));

        $data['breadcrumbs'] = array();

        $data['breadcrumbs'][] = array(
            'text'      => $this->language->get('text_home'),
            'href'      => $this->url->link('common/home')
        );

        $url = '';

        if (isset($this->request->get['page'])) {
            $url .= '&page=' . $this->request->get['page'];
        }

        if (isset($this->request->get['limit'])) {
            $url .= '&limit=' . $this->request->get['limit'];
        }

        $data['breadcrumbs'][] = array(
            'text'      => $this->language->get('heading_title'),
            'href'      => $this->url->link('product/new', $url)
        );

        $data['heading_title'] = $this->language->get('heading_title');

        $data['text_empty'] = $this->language->get('text_empty');
        $data['text_quantity'] = $this->language->get('text_quantity');
        $data['text_manufacturer'] = $this->language->get('text_manufacturer');
        $data['text_model'] = $this->language->get('text_model');
        $data['text_price'] = $this->language->get('text_price');
        $data['text_tax'] = $this->language->get('text_tax');
        $data['text_points'] = $this->language->get('text_points');
        $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
        $data['text_display'] = $this->language->get('text_display');
        $data['text_list'] = $this->language->get('text_list');
        $data['text_grid'] = $this->language->get('text_grid');
        $data['text_limit'] = $this->language->get('text_limit');
        $data['text_sort'] = $this->language->get('text_sort');

        $data['button_cart'] = $this->language->get('button_cart');
        $data['button_wishlist'] = $this->language->get('button_wishlist');
        $data['button_compare'] = $this->language->get('button_compare');
        $data['button_list'] = $this->language->get('button_list');
        $data['button_grid'] = $this->language->get('button_grid');

        $data['text_read_mode_ajax'] = $this->language->get('text_read_mode_ajax');
        $data['bestseller_label_text'] = $this->language->get('bestseller_label_text');
        $data['new_product_label_text'] = $this->language->get('new_product_label_text');
        $data['not_available_label_text'] = $this->language->get('not_available_label_text');
        $data['action_product_label_text'] = $this->language->get('action_product_label_text');

        // lightshop
        if (file_exists(DIR_APPLICATION.'controller/extension/module/lightshop_main_slider.php')) { 
            $this->load->language('extension/theme/lightshop');
            $data['schema'] = $this->config->get('theme_lightshop_schema');
            $data['product_detail'] = $this->config->get('theme_lightshop_product_detail');
            $data['category_background'] = $this->config->get('theme_lightshop_category_background');
            $data['category_sorts'] = $this->config->get('theme_lightshop_category_sorts');
            $data['category_limits'] = $this->config->get('theme_lightshop_category_limits');
            $data['category_categories'] = $this->config->get('theme_lightshop_category_categories');

            $data['button_fastorder_sendorder'] = $this->language->get('button_lighshop_sendorder');
            $data['text_lightshop_buy_click'] = $this->language->get('text_lightshop_buy_click');

            $data['pс_view'] = $this->config->get('theme_lightshop_pс_view');
            $data['mobile_view'] = $this->config->get('theme_lightshop_mobile_view');

            if ($this->config->get('theme_lightshop_buy_click_pdata')) {
                $this->load->language('extension/theme/lightshop');
                $this->load->model('catalog/information');

                $information_info = $this->model_catalog_information->getInformation($this->config->get('theme_lightshop_buy_click_pdata'));

                if ($information_info) {
                    $data['text_lightshop_pdata'] = sprintf($this->language->get('text_lightshop_pdata'), $this->language->get('button_lighshop_sendorder'), $this->url->link('information/information/agree', 'information_id=' . $this->config->get('theme_lightshop_buy_click_pdata'), true), $information_info['title'], $information_info['title']);
                } 
                else {
                    $data['text_lightshop_pdata'] = '';
                }
            } 
            else {
                $data['text_lightshop_pdata'] = '';
            }
      
            $data['buy_click'] = array();
            if($this->config->get('theme_lightshop_buy_click')){
                $data['buy_click'] = $this->config->get('theme_lightshop_buy_click');

                if ($this->customer->isLogged()) {
                    $this->load->model('account/customer');
                    $data['customer_info'] = $this->model_account_customer->getCustomer($this->customer->getId());
                }
            }     

            $this->load->language('checkout/checkout');
            
            $data['entry_firstname'] = $this->language->get('entry_firstname');
            $data['entry_lastname'] = $this->language->get('entry_lastname');
            $data['entry_email'] = $this->language->get('entry_email');
            $data['entry_telephone'] = $this->language->get('entry_telephone');
            $data['entry_comment'] = $this->language->get('entry_comment');
        }
        // lightshop end

        if (file_exists(DIR_LANGUAGE.'ru-ru/extension/module/royal.php') or file_exists(DIR_LANGUAGE.'en-gb/extension/module/royal.php')) {

			$this->load->language('extension/module/royal');

            $data['language_id'] = $this->config->get('config_language_id');
            $data['button_quickview'] = $this->language->get('button_quickview');
            $data['button_instock'] = $this->language->get('button_instock');
            $data['royal_sort_cat'] = $this->config->get('royal_sort_cat');
            $data['royal_count_cat'] = $this->config->get('royal_count_cat');
            $data['royal_wishlist_cat'] = $this->config->get('royal_wishlist_cat');
            $data['royal_compare_cat'] = $this->config->get('royal_compare_cat');
            $data['royal_rating_cat'] = $this->config->get('royal_rating_cat');
            $data['royal_name_sticker_product_new'] = $this->config->get('royal_name_sticker_product_new');
            $data['royal_name_sticker_product_top'] = $this->config->get('royal_name_sticker_product_top');		
            $data['royal_sticker_sale_product_auto'] = $this->config->get('royal_sticker_sale_product_auto');	
            $data['royal_sticker_new_product_auto'] = $this->config->get('royal_sticker_new_product_auto');
            $data['royal_sticker_product_new_day'] = $this->config->get('royal_sticker_product_new_day');
            $data['royal_sticker_product_top_rating'] = $this->config->get('royal_sticker_product_top_rating');
            $data['royal_sticker_product_top_viewed'] = $this->config->get('royal_sticker_product_top_viewed');
            $data['royal_sticker_product_top_ratinr'] = $this->config->get('royal_sticker_product_top_ratinr');
            $data['royal_sticker_top_product_auto'] = $this->config->get('royal_sticker_top_product_auto');
            $data['aridius_qckview_status'] = $this->config->get('aridius_qckview_status');
            $data['royal_limit_symbolst'] = $this->config->get('royal_limit_symbolst');
            $data['aridiusinstock_status'] = $this->config->get('aridiusinstock_status');
        }

        $data['compare'] = $this->url->link('product/compare');

        $data['products'] = array();

        $filter_data = array(
            'day_limit' => $day_limit,
            'sort'  => 'p.'.$sort,
            'order' => $order,
            'start' => 0,
            'limit' => $product_limit
        );

        $product_total = count($this->model_catalog_product->getProducts($filter_data));
        //echo 'product_total='.$product_total;

        $filter_data = array(
            'day_limit' => $day_limit,
            'sort'  => 'p.'.$sort,
            'order' => $order,
            'start' => ($page - 1) * $limit,
            'limit' => $limit
        );

        $results = $this->model_catalog_product->getProducts($filter_data);
        //print_r($results);
        foreach ($results as $result) {
            if ($result['image']) {
                $image = $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
            } else {
                $image = $this->model_tool_image->resize('placeholder.png', $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
            }

            if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
                $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
            } else {
                $price = false;
            }

            if ((float)$result['special']) {
                $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
            } else {
                $special = false;
            }

            if ($this->config->get('config_tax')) {
                $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);
            } else {
                $tax = false;
            }

            if ($this->config->get('config_review_status')) {
                $rating = (int)$result['rating'];
            } else {
                $rating = false;
            }


            if (isset($result['meta_description']) and !empty($result['meta_description'])) {
                $descr = $result['meta_description'];
            }
            else {
                $descr = strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'));

                $i = 0;
                $j = $this->config->get('config_product_description_length');
                while (substr($descr, $j, 1) != '.' and $i <= 1500) {
                    $i++;
                    $j++;
                }

                $descr = substr($descr, 0, ($j+1) );
            }


            $other_img = $this->model_catalog_product->getProductImages($result['product_id']);
            $image2 = false;
            if (count($other_img) > 0) {
                $image2 = $this->model_tool_image->resize($other_img[0]['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
            }


			if (isset($result['mpn']) and $result['mpn'] > 0) {
				$price_unit = $this->currency->format((float)$result['special'] ? $result['special']/$result['mpn'] : $result['price']/$result['mpn'], $this->session->data['currency']);
			} else {
				$price_unit = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);
			}


            $arr_attributes = array();
            $attributes = $this->model_catalog_product->getProductAttributes($result['product_id']);

            foreach ($attributes as $attribute_group) {
                foreach ($attribute_group['attribute'] as $attribute) {   
                    $arr_attributes[] = array(
                        'name' => $attribute['name'],
                        'text' => $attribute['text']
                    );
                }
            }

            // oct_advanced_attributes_settings start
            $oct_attributes = array();
            $oct_advanced_attributes_settings_data = $this->config->get('oct_advanced_attributes_settings_data');

            if (isset($oct_advanced_attributes_settings_data['status']) && $oct_advanced_attributes_settings_data['status']) {
                foreach ($attributes as $attribute_group) {
                    foreach ($attribute_group['attribute'] as $attribute) {
                        if (isset($oct_advanced_attributes_settings_data['allowed_attributes']) && (in_array($attribute['attribute_id'], $oct_advanced_attributes_settings_data['allowed_attributes']))) {
                                
                            $oct_attributes[] = array(
                                'name' => $attribute['name'],
                                'text' => $attribute['text']
                            );
                        }
                    }
                }
            }
            // oct_advanced_attributes_settings end
      

        // oct_advanced_options_settings start
        $oct_options = array();
        $oct_advanced_options_settings_data = $this->config->get('oct_advanced_options_settings_data');
        foreach ($this->model_catalog_product->getProductOptions($result['product_id']) as $option) {
          $product_option_value_data = array();
          if (isset($oct_advanced_options_settings_data['allowed_options']) && (in_array($option['option_id'], $oct_advanced_options_settings_data['allowed_options']))) {
            foreach ($option['product_option_value'] as $option_value) {
              if (!$option_value['subtract'] || ($option_value['quantity'] >= 0)) {
                if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
                  $oct_option_price = $this->currency->format($this->tax->calculate($option_value['price'], $result['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
                } else {
                  $oct_option_price = false;
                }
                $product_option_value_data[] = array(
                  'product_option_value_id' => $option_value['product_option_value_id'],
                  'option_value_id'         => $option_value['option_value_id'],
                  'name'                    => $option_value['name'],
                  'image'                   => $option_value['image'] ? $this->model_tool_image->resize($option_value['image'], 50, 50) : '',
                  'price'                   => $oct_option_price,
                  'price_prefix'            => $option_value['price_prefix']
               );
              }
            }
            $oct_options[] = array(
              'product_option_id'    => $option['product_option_id'],
              'product_option_value' => $product_option_value_data,
              'option_id'            => $option['option_id'],
              'name'                 => $option['name'],
              'type'                 => $option['type'],
              'value'                => $option['value'],
              'required'             => $option['required']
            );
          }
        }
        // oct_advanced_options_settings end
      

        $oct_product_stickers_data = $this->config->get('oct_product_stickers_data');
        $oct_product_stickers = array();

        if (isset($oct_product_stickers_data['status']) && $oct_product_stickers_data['status']) {
          $this->load->model('catalog/oct_product_stickers');

          if (isset($result['oct_product_stickers']) && $result['oct_product_stickers']) {
            $stickers = unserialize($result['oct_product_stickers']);
          } else {
            $stickers = array();
          }

          if ($stickers) {
              foreach ($stickers as $product_sticker_id) {
                $sticker_info = $this->model_catalog_oct_product_stickers->getProductSticker($product_sticker_id);
                
                if ($sticker_info) {
                  $oct_product_stickers[] = array(
                    'text' => $sticker_info['text'],
                    'color' => $sticker_info['color'],
                    'background' => $sticker_info['background']
                  );
                }
              }
    
              $sticker_sort_order = array();
    
              foreach ($stickers as $key => $product_sticker_id) {
                $sticker_info = $this->model_catalog_oct_product_stickers->getProductSticker($product_sticker_id);
                
                if ($sticker_info) {
                  $sticker_sort_order[$key] = $sticker_info['sort_order'];
                }
              }
              
              array_multisort($sticker_sort_order, SORT_ASC, $oct_product_stickers);
          }
        }


            // oct_techstore start
            if ($result['quantity'] <= 0) {
                $stock = $result['stock_status'];
            } 
            elseif ($this->config->get('config_stock_display')) {
                $stock = $result['quantity'];
            } 
            else {
                $stock = $this->language->get('text_instock');
            }
            // oct_techstore end

			$oct_product_preorder_text = $this->config->get('oct_product_preorder_text');
			$oct_product_preorder_data = $this->config->get('oct_product_preorder_data');
			$oct_product_preorder_language = $this->load->language('extension/module/oct_product_preorder');
			$data['text_stock'] = $this->language->get('text_stock');
		
			if (isset($oct_product_preorder_data['status']) && $oct_product_preorder_data['status'] && isset($oct_product_preorder_data['stock_statuses']) && isset($result['oct_stock_status_id']) && in_array($result['oct_stock_status_id'], $oct_product_preorder_data['stock_statuses'])) {
				$product_preorder_text = $oct_product_preorder_text[$this->session->data['language']]['call_button'];
				$product_preorder_status = 1;
			} else {
				$product_preorder_text = $oct_product_preorder_language['text_out_of_stock'];
				$product_preorder_status = 2;
			}

            $orders = 0;
            if (method_exists($this->model_catalog_product, 'getCountOrderProduct')) {
                $orders = $this->model_catalog_product->getCountOrderProduct($result['product_id']);
            }

            $user_id = $this->customer->getId();

            if ($user_id and method_exists($this->model_catalog_product, 'getProductLikeUser')) {
                $user_like_this = $this->model_catalog_product->getProductLikeUser($result['product_id'], $user_id);
            } else {
                $user_like_this = false;
            }


            $data['registered_user'] = $this->customer->getID();

            if (isset($result['youtube'])) {
                $youtube = $result['youtube'];
            } else {
                $youtube = "";
            }


            $data['products'][] = array(
                'product_id'  => $result['product_id'],
                'thumb'       => $image,
                'thumb2'      => $image2,
                'stock'       => $result['quantity'],
                'quantity'    => $result['quantity'],
                'name'        => $result['name'],
                'description' => $descr,
                'price'       => $price,
                'model'       => $result['model'],
                'special'     => $special,
                'tax'         => $tax,

                'attr'        => $arr_attributes,
                'orders'      => $orders,
                'youtube'     => $youtube,
                'user_like_this' => $user_like_this,
                'likes'       => isset($result['likes']) ? $result['likes'] : '',
                'reward'      => isset($result['reward']) ? $result['reward'] : '',

                // oct_techstore start
                'saving'      => round((($result['price'] - $result['special'])/($result['price'] + 0.01))*100, 0),
                'model'       => $result['model'],
                'stock'       => $stock,
                // oct_techstore end
      

                'oct_product_stickers' => $oct_product_stickers,
      

                // oct_advanced_options_settings start
                'oct_options' => $oct_options,
                // oct_advanced_options_settings end


                // oct_advanced_attributes_settings start
                'oct_attributes' => $oct_attributes,
                // oct_advanced_attributes_settings end

				'quantity'       => $result['quantity'], 
				'product_preorder_text' => $product_preorder_text,
				'product_preorder_status' => $product_preorder_status,

                'upc' 	      => $result['upc'],
                'weight'      => round($result['weight'], 2),
                'weight_class'=> $this->weight->getUnit($result['weight_class_id']),
                'minimum'     => $result['minimum'] > 0 ? $result['minimum'] : 1,
                'dateadded'   => $result['date_added'],
                'stickers'    => isset($result['stickers']) ? $result['stickers'] : '',
                'mpn'         => (isset($result['mpn']) and $result['mpn'] > 0) ? $result['mpn'] : 1,
                'price_unit'  => $price_unit,
                'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']),
                'manufacturer' => $result['manufacturer'],
                'manufacturer_link' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id']),
                'rating'      => $rating,
                'reviews'     => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
                'href'        => $this->url->link('product/product', $url . '&product_id=' . $result['product_id'])
            );
        }

        $url = '';

        $data['limits'] = array();

        $limits = array_unique(array($this->config->get($this->config->get('config_theme') . '_product_limit'), 25, 50, 75, 100));

        sort($limits);

        foreach($limits as $value) {
            $data['limits'][] = array(
                'text'  => $value,
                'value' => $value,
                'href'  => $this->url->link('product/new', $url . '&limit=' . $value)
            );
        }

        $url = '';

        if (isset($this->request->get['limit'])) {
            $url .= '&limit=' . $this->request->get['limit'];
        }

        $data['has_pages'] = false;

        if (ceil($product_total/$limit) > 1) {
            $pagination = new Pagination();
            $pagination->total = $product_total;
            $pagination->page = $page;
            $pagination->limit = $limit;
            $pagination->text = $this->language->get('text_pagination');
            $pagination->url = $this->url->link('product/' . $this->name, $url . '&page={page}');

            $data['pagination'] = $pagination->render();
            $data['results'] = sprintf($this->language->get('text_pagination'), ($product_total) ? (($page - 1) * $limit) + 1 : 0, ((($page - 1) * $limit) > ($product_total - $limit)) ? $product_total : ((($page - 1) * $limit) + $limit), $product_total, ceil($product_total / $limit));

            $data['has_pages'] = true;
        }
        else {
            $data['pagination'] = '';
            $data['results'] = '';
        }


        $data['limit'] = $limit;

        // lightshop  
        if (file_exists(DIR_APPLICATION.'controller/extension/module/lightshop_main_slider.php')) {  
            if (isset($this->request->get['view'])) {
                $view = $this->request->get['view'];
                $viewM = $this->request->get['view'];
            }
            elseif (isset($this->session->data['view'])) {
                $view = $this->session->data['view'];
                $viewM = $this->session->data['view'];
            } 
            else {
                $view = $this->config->get('theme_lightshop_pс_view');
                $viewM = $this->config->get('theme_lightshop_mobile_view');
            }

            if (isset($_COOKIE["ismobile"]) && $_COOKIE["ismobile"] == 1) { 
                $this->session->data['view'] = $viewM;
            } 
            else {
                $this->session->data['view'] = $view;
            }

            $data['viewLayer'] = $view;
            $data['viewLayerM'] = $viewM;
            $viewSub = '';
            $data['viewSub'] = '';

            if (strpos($this->session->data['view'],'main') === false) {  
                $data['view'] = $this->session->data['view'];
            } 
            else {
                $data['view'] = $this->session->data['view'];

                $viewSub = explode('-',$data['view']);

                if (isset($viewSub[1])) {
                    $viewSub = '--'.$viewSub[1];
                    $data['viewSub'] = 'catalogue__products-list'.$viewSub;
                    $data['viewLayerM'] = 'main';
                }
                else {
                    $data['viewSub'] = '';            
                }

                $data['view'] = 'main';
            }     
                

            if (isset($this->request->get['view'])) {
              $this->response->setOutput($this->load->view('product/category_'.$data['view'], $data));
              
              return ;
            } 
            elseif (isset($this->request->get['popupdetail'])) {
              $this->response->setOutput($this->load->view('product/category_popup', $data));
              
              return ;      
            }
        }
        // lightshop end

        $data['column_left'] = $this->load->controller('common/column_left');
        $data['column_right'] = $this->load->controller('common/column_right');
        $data['content_top'] = $this->load->controller('common/content_top');
        $data['content_bottom'] = $this->load->controller('common/content_bottom');
        $data['footer'] = $this->load->controller('common/footer');
        $data['header'] = $this->load->controller('common/header');

        $this->response->setOutput($this->load->view('product/'.$this->name, $data));

    }


    public function ajaxLoadProducts(){
              
        $this->load->model('catalog/category');
        $this->load->model('catalog/product');
        $this->load->model('tool/image');

        $this->load->language('product/new');
        $this->load->model('extension/'.$this->type);

        $module_info = $this->model_extension_module->getModuleByCode($this->name);
      //  print_r($module_info);

        if (is_array($module_info)) {
            $sort = $module_info['sort'];
            $day_limit = $module_info['day_limit'];
            $product_limit = $module_info['product_limit'];
        }
        else {
            $sort = $module_info->sort;
            $day_limit = $module_info->day_limit;
            $product_limit = $module_info->product_limit;
        }


        $order = 'DESC';

        if (!$sort) {
            $sort = 'date_added';
        }


        if (isset($this->request->get['page'])) {
            $page = $this->request->get['page'];
        }
        else {
            $page = 1;
        }

        if (isset($this->request->get['limit'])) {
            $limit = (int)$this->request->get['limit'];
        } else {
            $limit = $this->config->get($this->config->get('config_theme') . '_product_limit');
        }

        $url = '';

        if (isset($this->request->get['page'])) {
            $url .= '&page=' . $this->request->get['page'];
        }

        if (isset($this->request->get['limit'])) {
            $url .= '&limit=' . $this->request->get['limit'];
        }


        $data['products'] = array();

        $filter_data = array(
            'day_limit' => $day_limit,
            'sort'  => 'p.'.$sort,
            'order' => $order,
            'start' => 0,
            'limit' => $product_limit
        );

        $product_total = count($this->model_catalog_product->getProducts($filter_data));
        //echo 'product_total='.$product_total;

        $filter_data = array(
            'day_limit' => $day_limit,
            'sort'  => 'p.'.$sort,
            'order' => $order,
            'start' => ($page - 1) * $limit,
            'limit' => $limit
        );

        $results = $this->model_catalog_product->getProducts($filter_data);


        $data['remarketing_ids'] = array();
      
        $json['registered_user'] = $this->customer->getID();

        if($results){
            $json['success'] = true;
        } else {
            $json['success'] = false;
        }
        $json['text_reward'] = $this->language->get('text_reward');
        $json['button_cart'] = $this->language->get('button_cart');
        foreach ($results as $result) {
            $resultsAttr = $this->model_catalog_product->getProductAttributes($result['product_id']);

            $attr = array();
            if($resultsAttr){
                foreach ($resultsAttr as $resultAttr) {
                    foreach ($resultAttr['attribute'] as $attribute) {
                        array_push($attr, $attribute);
                    }
                }
            }

            if ($result['image']) {
                $image = $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
            } else {
                $image = $this->model_tool_image->resize('placeholder.png', $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
            }

            if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
                $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
            } else {
                $price = false;
            }

            if ((float)$result['special']) {
                $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
            } else {
                $special = false;
            }

            if ($result['youtube']) {
                $youtube = $result['youtube'];
            } else {
                $youtube = "";
            }


            if ($this->config->get('config_tax')) {
                $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);
            } else {
                $tax = false;
            }

            if ($this->config->get('config_review_status')) {
                $rating = (int)$result['rating'];
            } else {
                $rating = false;
            }
            $orders = $this->model_catalog_product->getCountOrderProduct($result['product_id']);


            if($user_id = $this->customer->getId()){
                $user_like_this = $this->model_catalog_product->getProductLikeUser($result['product_id'], $user_id);
            }else{
                $user_like_this = false;
            }

            $json['products'][] = array(
                'product_id'        => $result['product_id'],
                'thumb'             => $image,
                'currency'          => $this->session->data['currency'],
                'currency_price'    => number_format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')),2, '.', ''),
                'youtube'           => $youtube,
                'name'              => $result['name'],
                'quantity'          => $result['quantity'],
                'date_added'        => $result['date_added'],
                'user_like_this'    => $user_like_this,
                'likes'             => $result['likes'],
                'orders'            => $orders,
                'attr'              => $attr,
                'price'             => $price,
                'special'           => $special,
                'tax'               => $tax,
                'reward'            => $result['reward'],
                'href'              => $this->url->link('product/product', 'path=' . $category_id . '&product_id=' . $result['product_id'] . $url)
            );
        }

        $this->response->addHeader('Content-Type: application/json');
        $this->response->setOutput(json_encode($json));
    }

}
?>

php c контроллера, и tpl в теме который

финально страница выхлядит так https://prnt.sc/mm07qm , возможно колонок 3, но суть то в информации под картинкой

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.