Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

усиновка премиум темы на ocStore 3.0.2.0


Recommended Posts

Здравствуйте всем

сивлю тему на ocStore 3.0.2.0 

выдает икую ошибку, подскажите пожалуйси как попотому чтороть на простом опенкарт все хорошо, но я хочу на ocStore 3.0.2.0

/system/storage/modification/catalog/controller/startup/seo_url.php 134

тема эи https://www.templatemonster.com/ru/demo/64659.html

Link to comment
Share on other sites


3 часа назад, bersnik1 сказал:

Здравствуйте всем

усиновка премиум темы на ocStore 3.0.2.0

тема эи https://www.templatemonster.com/ru/demo/64659.html

Добрый, а если им напишут мегашнобель тем?
говорят им есть норм темы.. но я ни одногой нормальной им ещё не встречал.
Тут им люлей наваляют за икое, поэтому они бегут им выкладывать свою каку..
зато Премиум - ух..)

Link to comment
Share on other sites

ошипотому чток нету https://prnt.sc/pmyoyu

http://ledlight.spb.ru/
 

Спойлер

 

Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/startup/seo_url.php on line 134

--------------------------------------------------------

 

это сам файл

 

<?php
// *    @source        See SOURCE.txt for source and other copyright.
// *    @license    GNU General Public License version 3; see LICENSE.txt

class ControllerStartupSeoUrl extends Controller {
    
    //seopro start
        private $seo_pro;
        public function __construct($registry) {
            parent::__construct($registry);    
            $this->seo_pro = new SeoPro($registry);
        }
    //seopro end
    
    public function index() {

        // Add rewrite to url class
        if ($this->config->get('config_seo_url')) {
            $this->url->addRewrite($this);
        }
        
    
        // Decode URL
        if (isset($this->request->get['_route_'])) {
            $parts = explode('/', $this->request->get['_route_']);
            
        //seopro prepare route
        if($this->config->get('config_seo_pro')){        
            $parts = $this->seo_pro->prepareRoute($parts);
        }
        //seopro prepare route end

            // remove any empty arrays from trailing
            if (utf8_strlen(end($parts)) == 0) {
                array_pop($parts);
            }

            foreach ($parts as $part) {
                $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE keyword = '" . $this->db->escape($part) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "'");

                if ($query->num_rows) {
                    $url = explode('=', $query->row['query']);

                    if ($url[0] == 'product_id') {
                        $this->request->get['product_id'] = $url[1];
                    }


                if($url[0] == 'simple_blog_article_id') {
                $this->request->get['simple_blog_article_id'] = $url[1];
                }
                if($url[0] == 'simple_blog_author_id') {
                $this->request->get['simple_blog_author_id'] = $url[1];
                }
                if ($url[0] == 'simple_blog_category_id') {
                if (!isset($this->request->get['simple_blog_category_id'])) {
                $this->request->get['simple_blog_category_id'] = $url[1];
                } else {
                $this->request->get['simple_blog_category_id'] .= '_' . $url[1];
                }
                }
                
                    if ($url[0] == 'category_id') {
                        if (!isset($this->request->get['path'])) {
                            $this->request->get['path'] = $url[1];
                        } else {
                            $this->request->get['path'] .= '_' . $url[1];
                        }
                    }

                    if ($url[0] == 'manufacturer_id') {
                        $this->request->get['manufacturer_id'] = $url[1];
                    }

                    if ($url[0] == 'information_id') {
                        $this->request->get['information_id'] = $url[1];
                    }

                    if ($query->row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id' && $url[0] != 'simple_blog_article_id' && $url[0] != 'simple_blog_author_id' && $url[0] != 'simple_blog_category_id') {
                        $this->request->get['route'] = $query->row['query'];
                    }
                } else {
                    if(!$this->config->get('config_seo_pro')){        
                        
                if(($this->config->has('simple_blog_seo_keyword')) && ($this->db->escape($part) == $this->config->get('theme_' . $this->config->get('config_theme') . '_simple_blog_seo_keyword'))) {
                } else if($this->db->escape($part) == 'simple-blog') {
                } else {
                $this->request->get['route'] = 'error/not_found';
                break;
                }
                
                    break;
                }
            }

            if (!isset($this->request->get['route'])) {
                if (isset($this->request->get['product_id'])) {
                    $this->request->get['route'] = 'product/product';
                } elseif (isset($this->request->get['path'])) {
                    $this->request->get['route'] = 'product/category';
                } elseif (isset($this->request->get['manufacturer_id'])) {
                    $this->request->get['route'] = 'product/manufacturer/info';
                } elseif (isset($this->request->get['information_id'])) {
                    
                $this->request->get['route'] = 'information/information';
                } else if (isset($this->request->get['simple_blog_article_id'])) {
                $this->request->get['route'] = 'simple_blog/article/view';
                } else if (isset($this->request->get['simple_blog_author_id'])) {
                $this->request->get['route'] = 'simple_blog/author';
                } else if (isset($this->request->get['simple_blog_category_id'])) {
                $this->request->get['route'] = 'simple_blog/category';
                }
                else {
                if(($this->config->has('simple_blog_seo_keyword'))) {
                if($this->request->get['_route_'] == $this->config->get('theme_' . $this->config->get('config_theme') . '_simple_blog_seo_keyword')) {
                $this->request->get['route'] = 'simple_blog/article';
                }
                } if($this->request->get['_route_'] == 'simple-blog') {
                $this->request->get['route'] = 'simple_blog/article';
                }
                
                }
            }
        }
        
        //seopro validate
        if($this->config->get('config_seo_pro')){        
            $this->seo_pro->validate();
        }
    //seopro validate
        
    }

    public function rewrite($link) {
        $url_info = parse_url(str_replace('&amp;', '&', $link));

        if($this->config->get('config_seo_pro')){        
        $url = null;
            } else {
        $url = '';
        }

        $data = array();

        parse_str($url_info['query'], $data);
        
        //seo_pro baseRewrite
        if($this->config->get('config_seo_pro')){        
            list($url, $data, $postfix) =  $this->seo_pro->baseRewrite($data, (int)$this->config->get('config_language_id'));    
        }
        
        

        
        //seo_pro baseRewrite

        foreach ($data as $key => $value) {
            if (isset($data['route'])) {
                if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {
                    $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");

                    if ($query->num_rows && $query->row['keyword']) {
                        $url .= '/' . $query->row['keyword'];

                        unset($data[$key]);
                    }
                
                } else if($data['route'] == 'simple_blog/article/view' && $key == 'simple_blog_article_id') {
                $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
                if ($query->num_rows) {
                $url .= '/' . $query->row['keyword'];
                unset($data[$key]);
                } else {
                $url .= '/simple-blog/' . (int)$value;
                unset($data[$key]);
                }
                } else if($data['route'] == 'simple_blog/author' && $key == 'simple_blog_author_id') {
                $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($key . '=' . (int)$value) . "'");
                if ($query->num_rows) {
                $url .= '/' . $query->row['keyword'];
                unset($data[$key]);
                } else {
                $url .= '/simple-blog/' . (int)$value;
                unset($data[$key]);
                }
                } else if($data['route'] == 'simple_blog/category' && $key == 'simple_blog_category_id') {
                $blog_categories = explode("_", $value);
                foreach ($blog_categories as $blog_category) {
                $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'simple_blog_category_id=" . (int)$blog_category . "'");
                if ($query->num_rows) {
                $url .= '/' . $query->row['keyword'];
                } else {
                $url .= '/simple-category' . $blog_category;
                }
                }
                unset($data[$key]);
                } else if($data['route'] == 'simple_blog/search') {
                //echo $data['route'];
                if(isset($key) && ($key == 'blog_search')) {
                $url .= '/search&blog_search=' . $value;
                } else {
                $url .= '/search';
                }
                //echo $url; 
                } else if(isset($data['route']) && $data['route'] == 'simple_blog/article' && $key != 'simple_blog_article_id' && $key != 'simple_blog_author_id' && $key != 'simple_blog_category_id' && $key != 'page') {
                if($this->config->has('simple_blog_seo_keyword')) {
                $url .=  '/' . $this->config->get('theme_' . $this->config->get('config_theme') . '_simple_blog_seo_keyword');
                } else {
                $url .=  '/simple-blog';
                }
                } elseif ($key == 'path') {
                
                    $categories = explode('_', $value);

                    foreach ($categories as $category) {
                        $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");

                        if ($query->num_rows && $query->row['keyword']) {
                            $url .= '/' . $query->row['keyword'];
                        } else {
                            $url = '';

                            break;
                        }
                    }

                    unset($data[$key]);
                }
            }
        }

        //seo_pro add blank url
        if($this->config->get('config_seo_pro')) {        
            $condition = ($url !== null);
        } else {
            $condition = $url;
        }

        if ($condition) {
            if($this->config->get('config_seo_pro')){        
                if($this->config->get('config_page_postfix') && $postfix) {
                    $url .= $this->config->get('config_page_postfix');
                } elseif($this->config->get('config_seopro_addslash')) {
                    $url .= '/';
                } 
            }
            
        //seo_pro add blank url
            unset($data['route']);

            $query = '';

            if ($data) {
                foreach ($data as $key => $value) {
                    $query .= '&' . rawurlencode((string)$key) . '=' . rawurlencode((is_array($value) ? http_build_query($value) : (string)$value));
                }

                if ($query) {
                    $query = '?' . str_replace('&', '&amp;', trim($query, '&'));
                }
            }

            return $url_info['scheme'] . '://' . $url_info['host'] . (isset($url_info['port']) ? ':' . $url_info['port'] : '') . str_replace('/index.php', '', $url_info['path']) . $url . $query;
        } else {
            return $link;
        }
    }
}

 

 

Link to comment
Share on other sites


вот теперьь ошибки появились

 

Спойлер

2019-10-23 9:36:29 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 16
2019-10-23 9:36:29 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:30 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:30 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:30 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:30 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 167
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 16
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 131
2019-10-23 9:36:31 - PHP Notice:  Undefined index: layout_type in /home/host1790641/ledlight.spb.ru/htdocs/www/system/storage/modification/catalog/controller/extension/module/featured.php on line 167

 

Link to comment
Share on other sites


6 минут назад, bersnik1 сказал:

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

Нет, возможно это проблемный модификатор

Добавив закрывающую фигурную скобку - избавились от синиксической ошибки, но не факт что при этом сохранилась правильная логика. Разбираться в портянке текси, которую ты выложил, просто невозможно...

  • +1 1
Link to comment
Share on other sites

файл featured.php

Спойлер

 

<?php
class ControllerExtensionModuleFeatured extends Controller {
    public function index($setting) {

                static $module = 0;
                
        $this->load->language('extension/module/featured');

        $this->load->model('catalog/product');

        $this->load->model('tool/image');


                $this->document->addStyle('catalog/view/javascript/jquery/swiper/css/swiper.min.css');
                $this->document->addScript('catalog/view/javascript/jquery/swiper/js/swiper.jquery.js');
                $data['layout_type']  = $setting['layout_type'];
                
        $data['products'] = array();

                $data['label_sale']     = $this->config->get('theme_' . $this->config->get('config_theme') . '_label_sale');
                $data['label_discount'] = $this->config->get('theme_' . $this->config->get('config_theme') . '_label_discount');
                $data['label_new']      = $this->config->get('theme_' . $this->config->get('config_theme') . '_label_new');
                

        if (!$setting['limit']) {
            $setting['limit'] = 4;
        }

        if (!empty($setting['product'])) {
            $products = array_slice($setting['product'], 0, (int)$setting['limit']);

                if ($this->config->get('theme_' . $this->config->get('config_theme') . '_label_new')) {
                $product_new = $this->model_catalog_product->getLatestProducts($this->config->get('theme_' . $this->config->get('config_theme') . '_label_new_limit'));
                }
                

            foreach ($products as $product_id) {
                $product_info = $this->model_catalog_product->getProduct($product_id);

                if ($this->config->get('theme_' . $this->config->get('config_theme') . '_label_new')) {
                $label_new = 0;
                foreach ($product_new as $product_new_id => $product) {
                if ($product_new[$product_new_id]['product_id'] == $product_id) {
                $label_new = 1;
                break;
                }
                }
                }
                

                if ($product_info) {
                    if ($product_info['image']) {
                        $image = $this->model_tool_image->resize($product_info['image'], $setting['width'], $setting['height']);
                    } else {
                        $image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']);
                    }


                $additional_image = $this->model_catalog_product->getProductImages($product_id);
                if ($additional_image) {
                $additional_image = $this->model_tool_image->resize($additional_image[0]['image'], $setting['width'], $setting['height']);
                } else {
                $additional_image = false;
                }
                
                    if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
                        $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
                    } else {
                        $price = false;
                    }

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

                $label_discount = '-' . (int)(100 - ($product_info['special'] * 100 / $product_info['price'])) . '%';
                
                    } else {
                        $special = false;

                $label_discount = false;
                
                    }

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

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


                $options = array();
                foreach ($this->model_catalog_product->getProductOptions($product_id) as $option) {
                $product_option_value_data = array();
                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']) {
                $price_option = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
                } else {
                $price_option = 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'                   => $this->model_tool_image->resize($option_value['image'], 50, 50),
                'price'                   => $price_option,
                'price_prefix'            => $option_value['price_prefix']
                );
                }
                }
                $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']
                );
                }
                

                $this->document->addStyle('catalog/view/javascript/jquery/swiper/css/swiper.min.css');
                $this->document->addScript('catalog/view/javascript/jquery/swiper/js/swiper.jquery.js');
                $data['layout_type']  = $setting['layout_type'];
                
                    $data['products'][] = array(
                        'product_id'  => $product_info['product_id'],
                        'thumb'       => $image,

                'additional_thumb' => $additional_image,
                

                'img-width'  => $setting['width'],
                'img-height' => $setting['height'],
                
                        'name'        => $product_info['name'],
 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 
                        'description' => utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('theme_' . $this->config->get('config_theme') . '_product_description_length')) . '..',
                        'price'       => $price,
                        'special'     => $special,

                'label_discount' => $label_discount,
                'label_new' => $this->config->get('theme_' . $this->config->get('config_theme') . '_label_new') ? $label_new : 0,
                
                        'tax'         => $tax,
                        'rating'      => $rating,
                        'href'        => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])

                ,
                'options'     => $options
                
                    );
                }
            }
        }


                $this->document->addStyle('catalog/view/javascript/jquery/swiper/css/swiper.min.css');
                $this->document->addScript('catalog/view/javascript/jquery/swiper/js/swiper.jquery.js');
                $data['layout_type']  = $setting['layout_type'];
                
        if ($data['products']) {

                $data['module'] = $module++;
                
            return $this->load->view('extension/module/featured', $data);
        }
    }
}

 

 

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

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.