Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Absalem

Користувачі
  
  • Публікації

    96
  • З нами

  • Відвідування

Повідомлення, опубліковані користувачем Absalem

  1. Отвечаю)

    Когда тему новую покупаешь, в ней обычно уже что-то понакручено, какие-то модули, где-то что-то выводится в неожиданных местах и не всегда стандартный функционал работает так, как должен, особенно при установке каких-то своих модулей (у меня есть несколько покупных тем от разных разработчиков в т.ч. и топ 100, у каждой свои проблемы и недоработки).

    Меня функционал сайта полностью устраивает, но не устраивает поведение элементов страниц при изменении ширины браузера, при открытии сайта на мобильных устройствах, не устраивает стиль кнопок, текста, менюшек, кое-каких иконок и т.д. Чтобы не заставлять дизайнера ломать голову над моими хотелками, я выберу тему на тимфоресте, верстка которой меня устраивает, и надо будет стили и верстку имеющегося сайта сделать так, как в теме. Если можно просто ткнуть пальцем, не покупая тему, и мне просто на текущем сайте сделают такое же, я не против :) 
     

  2. Есть у меня сайт на опенкарте, у которого отвратительное форматирование описаний категорий.

    Мне нужно, чтобы Вы написали для меня css-стиль, чтобы я взяла этот текст в div с классом(или ид), а стиль применился ко всем внутренним элементам.

    Мне нужен именно шаблон стиля, чтобы в нем можно было к каждому элементу прописать нужные мне вещи, цвета и размеры я буду потом подбирать, поэтому пишите любые значения форматирования. Надеюсь, понятно объяснила :)

     

    Стиль должен приментяться к следующим элементам: ко всему тексту - возможность задать шрифт. H2 - указать размер шрифта, цвет, положение центр строки, начертание жирное, апперкейс p - расстояние между строками, размер шрифта ul - маркер круг, отступ слева от края дива, отступ текста от маркера, отступ списка от окружающего текста/элементов ol - арабские цифры, отступ слева от края дива, отступ текста от нумерации, отступ списка от окружающего текста/элементов a - цвет, цвет при наведении, подчеркивание при наведении.

     

    В итоге нужен кусок css-стиля, который я вставлю в свой css-файл, подгоню в нём отступы, цвета и шрифты как мне нужно, поставлю текст в <div class=''></div> и форматирование всех элементов внутри дива станет таким, как я напишу в вашем шаблоне стиля.

     

    Оплата на карту сбера, телефон или яндекс-деньги.

  3. Доброго дня!

    У меня есть старый сайт, на котором стоит старая тема, куча модулей и кастомных допилов. Сколько будет стоить натянуть на него адаптивную вёрстку от темы, купленной на тимфоресте, не затрагивая функционал? (cайт свет 24 точка su)

  4. А можно поподробней описать что и куда нужно вносить пожалуйста, а то непонятно о чем речь идет.

     

    Решение взяла вот отсюда

     

    На всякий случай дублирую:

    В catalog/controller/common/seo_pro.php находите этот кусок 

    switch ($route) {
                case 'product/product':
                    if (isset($data['product_id'])) {
                        $tmp = $data;
                        $data = array();
                        if ($this->config->get('config_seo_url_include_path')) {
                            $data['path'] = $this->getPathByProduct($tmp['product_id']);
                            if (!$data['path']) return $link;
                        }
                        $data['product_id'] = $tmp['product_id'];
                        if (isset($tmp['tracking'])) {
                            $data['tracking'] = $tmp['tracking'];
                        }
                    }
                    break;

    И приводите его к вот такому виду: (по аналогии можно также опенстат дописать, yclid и остальное)

    switch ($route) {
                case 'product/product':
                    if (isset($data['product_id'])) {
                        $tmp = $data;
                        $data = array();
                        if ($this->config->get('config_seo_url_include_path')) {
                            $data['path'] = $this->getPathByProduct($tmp['product_id']);
                            if (!$data['path']) return $link;
                        }
                        $data['product_id'] = $tmp['product_id'];
                        if (isset($tmp['tracking'])) {
                            $data['tracking'] = $tmp['tracking'];
                        }
                        // --- add below
                        if (isset($tmp['utm_medium'])) {
                            $data['utm_medium'] = $tmp['utm_medium'];
                        }
                        if (isset($tmp['utm_source'])) {
                            $data['utm_source'] = $tmp['utm_source'];
                        }
                        if (isset($tmp['utm_campaign'])) {
                            $data['utm_campaign'] = $tmp['utm_campaign'];
                        }
                        if (isset($tmp['utm_content'])) {
                            $data['utm_content'] = $tmp['utm_content'];
                        }
                        // --- add above
                    }
                    break;
  5. для товаров с seo урлами

     

    
    SELECT name, price, concat("http://доменное_имя/", ua2.keyword, "/", ua1.keyword) as url
    FROM (
    SELECT concat( 'product_id=', p.product_id ) AS product_query, name, price, concat( 'category_id=', pc.category_id ) AS category_query
    FROM `oc_product_description` pd
    LEFT JOIN oc_product p ON (p.product_id=pd.product_id)
    LEFT JOIN oc_product_to_category pc ON (pc.product_id=p.product_id)
    WHERE p.date_available <= NOW() AND p.status = '1'
    )pd
    LEFT JOIN oc_url_alias ua1 ON ( pd.`product_query` = ua1.`query` )
    LEFT JOIN oc_url_alias ua2 ON ( pd.`category_query` = ua2.`query` )
    

    Спасибо за код! А можете подсказать, как сделать, чтобы правильно выгружались урлы и для товаров третьего уровня вложенности, там где в пути 2 категории?

    • +1 1
  6. При копировании товара сбрасывается главная категория до самого верхнего уровня категории - если сначала было "Диваны - Кожаные", то после копирования у нового товара будет главная категория "Диваны". Галочки в блоке  "Показывать в категориях" сохраняются.

    Где поправить?

  7. либо в таблице category нет поля parent_id (что странно)

    либо почему-то запрос не вернул результата по какому-то category_id (что более вероятно, но не менее странно)

    Спасибо за помощь! Ваш пост натолкнул меня на мысль и я проверила все колонки у категорий, оказалось у двух отключенных подкатегорий был sort_order -1 и когда в главном меню нажимали на родительскую категорию одной из этих подкатегорий вылезала ошибка. Исправила sort_order на 1 и ошибка исчезла!
  8. Добрый день!

    Заколебала меня уже эта ошибка)

    Undefined index: parent_id in ..../http/catalog/controller/module/category_accordion.php on line 89

    Подскажите, как поправить?

    Собственно на 89 строке и далее находится это:

     

    if ($query->row['parent_id'] == 0) {
    $this->parent_id = $category_id;
    } else { 
    $this->getCategoriesFromdb($query->row['parent_id']);
    }
     

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

     

    Сам файл:

    <?php
    class ControllerModuleCategoryAccordion extends Controller {
    	protected $category_id = 0;
    	protected $parent_id = 0;
    	protected $path = array();
    	
    	/*------------------------------------------------------------------------------*/
    
    	protected function index() {
    		$this->language->load('module/category_accordion');
    	   	$this->data['heading_title'] = $this->language->get('heading_title');
    		$this->load->model('catalog/category');
    		
    		if (isset($this->request->get['path'])) {
    			$this->path = explode('_', $this->request->get['path']);
    			
    			$this->category_id = end($this->path);
    		}
    		
    		$this->data['category_accordion'] = $this->loadCategories(0, '', $this->category_id);
    		$this->data['category_accordion_cid'] = $this->category_id;
    		$this->data['category_accordion_jquery_path'] = $this->config->get('config_url') . '/catalog/view/javascript/jquery';
    		
    		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/category_accordion.tpl')) {
    			$this->template = $this->config->get('config_template') . '/template/module/category_accordion.tpl';
    		} else {
    			$this->template = 'default/template/module/category_accordion.tpl';
    		}
    		
    		$this->render();
    	}
    	
    	/*------------------------------------------------------------------------------*/
    
    	protected function loadCategories($parent_id, $current_path = '', $cid = '') {
    		$category_id = array_shift($this->path);
    		$this->getCategoriesFromdb($category_id);
    		
    		$results = $this->model_catalog_category->getCategories($parent_id);
    		
    		$ret_string = '';
    		if ($results) { 
    			if ($parent_id == 0) {
    				$ret_string .= '<ul id="cat_accordion">'; 
    			} else {
    				$ret_string .= '<ul>'; 
    			}
    		}
    		
    		foreach ($results as $result) {	
    			if (!$current_path) {
    				$new_path = $result['category_id'];
    			} else {
    				$new_path = $current_path . '_' . $result['category_id'];
    			}
    			
    			$ret_string .= '<li class="custom_id' . $result['category_id'] . '">';
    			
    			$children = '';
    			$children = $this->loadCategories($result['category_id'], $new_path);
    			
    			if ($cid == $result['category_id']) {
    				$classactive = 'active';
    			} else {
    				$classactive = '';
    			}
    			
    			
    			if ($children) { 
    				$ret_string .= '<a class="' . $classactive . '" href="' . $this->url->link('product/category','path=' .  $new_path)  . '">' . $result['name'].' ('. $result['productsCount'] .')' . '</a> <span class="down"></span>';
    			} else { 
    				$ret_string .= '<a class="' . $classactive . '" href="' . $this->url->link('product/category','path=' .  $new_path)  . '">' . $result['name'].' ('. $result['productsCount'] .')' . '</a>';
    			}			
    			
            	$ret_string .= $children;
            	$ret_string .= '</li>'; 
    		}
     		
    		if ($results) $ret_string .= '</ul>'; 
    		return $ret_string;
    	}
    	
    	/*------------------------------------------------------------------------------*/
    	
    	protected function getCategoriesFromdb($category_id) {
    		if($category_id <=0) return false;
    		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.category_id = '" . (int)$category_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND c.status = '1'");
    		
    		if ($query->row['parent_id'] == 0) {
    			$this->parent_id = $category_id;
    		} else { 
    			$this->getCategoriesFromdb($query->row['parent_id']);
    		}
    	}	
    }
    ?>
    
  9. Вот собственно сам файл контроллера, и вставила я перед рендером вроде. Посмотрите, пожалуйста, может поймёте, в чём дело

    <?php  
    class ControllerProductProduct extends Controller {
    private $error = array(); 
    
    
    public function index() { 
    $this->language->load('product/product');
    
    
    $this->data['breadcrumbs'] = array();
    
    
    $this->data['breadcrumbs'][] = array(
    'text'      => $this->language->get('text_home'),
    'href'      => $this->url->link('common/home'), 
    'separator' => false
    );
    
    
    $this->load->model('catalog/category'); 
    
    
    if (isset($this->request->get['path'])) {
    $path = '';
    
    
    $parts = explode('_', (string)$this->request->get['path']);
    
    
    $category_id = (int)array_pop($parts);
    
    
    foreach ($parts as $path_id) {
    if (!$path) {
    $path = $path_id;
    } else {
    $path .= '_' . $path_id;
    }
    
    
    $category_info = $this->model_catalog_category->getCategory($path_id);
    
    
    if ($category_info) {
    $this->data['breadcrumbs'][] = array(
    'text'      => $category_info['name'],
    'href'      => $this->url->link('product/category', 'path=' . $path),
    'separator' => $this->language->get('text_separator')
    );
    }
    }
    
    
    // Set the last category breadcrumb
    $category_info = $this->model_catalog_category->getCategory($category_id);
    
    
    if ($category_info) { 
    $url = '';
    
    
    if (isset($this->request->get['sort'])) {
    $url .= '&sort=' . $this->request->get['sort'];
    } 
    
    
    if (isset($this->request->get['order'])) {
    $url .= '&order=' . $this->request->get['order'];
    } 
    
    
    if (isset($this->request->get['page'])) {
    $url .= '&page=' . $this->request->get['page'];
    }
    
    
    if (isset($this->request->get['limit'])) {
    $url .= '&limit=' . $this->request->get['limit'];
    }
    
    
    $this->data['breadcrumbs'][] = array(
    'text'      => $category_info['name'],
    'href'      => $this->url->link('product/category', 'path=' . $this->request->get['path']),
    'separator' => $this->language->get('text_separator')
    );
    }
    }
    
    
    $this->load->model('catalog/manufacturer'); 
    
    
    if (isset($this->request->get['manufacturer_id'])) {
    $this->data['breadcrumbs'][] = array( 
    'text'      => $this->language->get('text_brand'),
    'href'      => $this->url->link('product/manufacturer'),
    'separator' => $this->language->get('text_separator')
    ); 
    
    
    $url = '';
    
    
    if (isset($this->request->get['sort'])) {
    $url .= '&sort=' . $this->request->get['sort'];
    } 
    
    
    if (isset($this->request->get['order'])) {
    $url .= '&order=' . $this->request->get['order'];
    } 
    
    
    if (isset($this->request->get['page'])) {
    $url .= '&page=' . $this->request->get['page'];
    }
    
    
    if (isset($this->request->get['limit'])) {
    $url .= '&limit=' . $this->request->get['limit'];
    }
    
    
    $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);
    
    
    if ($manufacturer_info) { 
    $this->data['breadcrumbs'][] = array(
    'text'     => $manufacturer_info['name'],
    'href'     => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url), 
    'separator' => $this->language->get('text_separator')
    );
    }
    }
    
    
    if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {
    $url = '';
    
    
    if (isset($this->request->get['search'])) {
    $url .= '&search=' . $this->request->get['search'];
    }
    
    
    if (isset($this->request->get['tag'])) {
    $url .= '&tag=' . $this->request->get['tag'];
    }
    
    
    if (isset($this->request->get['description'])) {
    $url .= '&description=' . $this->request->get['description'];
    }
    
    
    if (isset($this->request->get['category_id'])) {
    $url .= '&category_id=' . $this->request->get['category_id'];
    } 
    
    
    if (isset($this->request->get['sub_category'])) {
    $url .= '&sub_category=' . $this->request->get['sub_category'];
    }
    
    
    if (isset($this->request->get['sort'])) {
    $url .= '&sort=' . $this->request->get['sort'];
    } 
    
    
    if (isset($this->request->get['order'])) {
    $url .= '&order=' . $this->request->get['order'];
    }
    
    
    if (isset($this->request->get['page'])) {
    $url .= '&page=' . $this->request->get['page'];
    }
    
    
    if (isset($this->request->get['limit'])) {
    $url .= '&limit=' . $this->request->get['limit'];
    }
    
    
    $this->data['breadcrumbs'][] = array(
    'text'      => $this->language->get('text_search'),
    'href'      => $this->url->link('product/search', $url),
    'separator' => $this->language->get('text_separator')
    );  
    }
    
    
    if (isset($this->request->get['product_id'])) {
    $product_id = (int)$this->request->get['product_id'];
    } else {
    $product_id = 0;
    }
    
    
    $this->load->model('catalog/product');
    
    
    $product_info = $this->model_catalog_product->getProduct($product_id);
    
    
    if ($product_info) {
    $url = '';
    
    
    if (isset($this->request->get['path'])) {
    $url .= '&path=' . $this->request->get['path'];
    }
    
    
    if (isset($this->request->get['filter'])) {
    $url .= '&filter=' . $this->request->get['filter'];
    }
    
    
    if (isset($this->request->get['manufacturer_id'])) {
    $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
    } 
    
    
    if (isset($this->request->get['search'])) {
    $url .= '&search=' . $this->request->get['search'];
    }
    
    
    if (isset($this->request->get['tag'])) {
    $url .= '&tag=' . $this->request->get['tag'];
    }
    
    
    if (isset($this->request->get['description'])) {
    $url .= '&description=' . $this->request->get['description'];
    } 
    
    
    if (isset($this->request->get['category_id'])) {
    $url .= '&category_id=' . $this->request->get['category_id'];
    }
    
    
    if (isset($this->request->get['sub_category'])) {
    $url .= '&sub_category=' . $this->request->get['sub_category'];
    } 
    
    
    if (isset($this->request->get['sort'])) {
    $url .= '&sort=' . $this->request->get['sort'];
    } 
    
    
    if (isset($this->request->get['order'])) {
    $url .= '&order=' . $this->request->get['order'];
    } 
    
    
    if (isset($this->request->get['page'])) {
    $url .= '&page=' . $this->request->get['page'];
    }
    
    
    if (isset($this->request->get['limit'])) {
    $url .= '&limit=' . $this->request->get['limit'];
    }
    
    
    $this->data['breadcrumbs'][] = array(
    'text'      => $product_info['name'],
    'href'      => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']),
    'separator' => $this->language->get('text_separator')
    ); 
    
    
    if ($product_info['seo_title']) {
    $this->document->setTitle($product_info['seo_title']);
    } else {
       $this->document->setTitle($product_info['name']);
    }
    
    
    $this->document->setDescription($product_info['meta_description']);
    $this->document->setKeywords($product_info['meta_keyword']);
    $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
    $this->document->addScript('catalog/view/javascript/jquery/tabs.js');
    $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
    $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
    
    
    if ($product_info['seo_h1']) {
    $this->data['heading_title'] = $product_info['seo_h1'];
    } else {
       $this->data['heading_title'] = $product_info['name'];
    }
    $this->data['text_select'] = $this->language->get('text_select');
    $this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
    $this->data['text_model'] = $this->language->get('text_model');
    $this->data['text_reward'] = $this->language->get('text_reward');
    $this->data['text_points'] = $this->language->get('text_points'); 
    $this->data['text_discount'] = $this->language->get('text_discount');
    $this->data['text_stock'] = $this->language->get('text_stock');
    $this->data['text_price'] = $this->language->get('text_price');
    $this->data['text_tax'] = $this->language->get('text_tax');
    $this->data['text_discount'] = $this->language->get('text_discount');
    $this->data['text_option'] = $this->language->get('text_option');
    $this->data['text_qty'] = $this->language->get('text_qty');
    $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);
    $this->data['text_or'] = $this->language->get('text_or');
    $this->data['text_write'] = $this->language->get('text_write');
    $this->data['text_note'] = $this->language->get('text_note');
    $this->data['text_share'] = $this->language->get('text_share');
    $this->data['text_wait'] = $this->language->get('text_wait');
    $this->data['text_tags'] = $this->language->get('text_tags');
    
    
    $this->data['entry_name'] = $this->language->get('entry_name');
    $this->data['entry_review'] = $this->language->get('entry_review');
    $this->data['entry_rating'] = $this->language->get('entry_rating');
    $this->data['entry_good'] = $this->language->get('entry_good');
    $this->data['entry_bad'] = $this->language->get('entry_bad');
    $this->data['entry_captcha'] = $this->language->get('entry_captcha');
    
    
    $this->data['button_cart'] = $this->language->get('button_cart');
    $this->data['button_wishlist'] = $this->language->get('button_wishlist');
    $this->data['button_compare'] = $this->language->get('button_compare'); 
    $this->data['button_upload'] = $this->language->get('button_upload');
    $this->data['button_continue'] = $this->language->get('button_continue');
    
    
    $this->load->model('catalog/review');
    
    
    $this->data['tab_description'] = $this->language->get('tab_description');
    $this->data['tab_attribute'] = $this->language->get('tab_attribute');
    $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']);
    $this->data['tab_related'] = $this->language->get('tab_related');
    
    
    $this->data['product_id'] = $this->request->get['product_id'];
    $this->data['manufacturer'] = $product_info['manufacturer'];
    $this->data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']);
    $this->data['model'] = $product_info['model'];
    $this->data['reward'] = $product_info['reward'];
    $this->data['points'] = $product_info['points'];
    $this->data['price_not_formatted'] = $product_info['price'];
    
    
    if ($product_info['quantity'] <= 0) {
    $this->data['stock'] = $product_info['stock_status'];
    } elseif ($this->config->get('config_stock_display')) {
    $this->data['stock'] = $product_info['quantity'];
    } else {
    $this->data['stock'] = $this->language->get('text_instock');
    }
    
    
    $this->load->model('tool/image');
    
    
    if ($product_info['image']) {
    $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
    } else {
    $this->data['popup'] = $this->model_tool_image->resize('no_image.jpg', $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
    }
    
    
    if ($product_info['image']) {
    $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
    $this->document->setOgImage($this->data['thumb']);
    } else {
    $this->data['thumb'] = $this->model_tool_image->resize('no_image.jpg', $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
    }
    
    
    $this->data['images'] = array();
    
    
    $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
    
    
    foreach ($results as $result) {
    $this->data['images'][] = array(
    'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
    'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
    );
    } 
    
    
    if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
    $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $this->data['price'] = false;
    }
    
    
    if ((float)$product_info['special']) {
    $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $this->data['special'] = false;
    }
    
    
    if ($this->config->get('config_tax')) {
    $this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']);
    } else {
    $this->data['tax'] = false;
    }
    
    
    $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
    
    
    $this->data['discounts'] = array(); 
    
    
    foreach ($discounts as $discount) {
    $this->data['discounts'][] = array(
    'quantity' => $discount['quantity'],
    'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
    );
    }
    
    
    $this->data['options'] = array();
    
    
    foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { 
    if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { 
    $option_value_data = array();
    
    
    foreach ($option['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 = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
    } else {
    $price = false;
    }
    
    
    $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,
    'price_prefix'            => $option_value['price_prefix']
    );
    }
    }
    
    
    $this->data['options'][] = array(
    'product_option_id' => $option['product_option_id'],
    'option_id'         => $option['option_id'],
    'name'              => $option['name'],
    'type'              => $option['type'],
    'option_value'      => $option_value_data,
    'required'          => $option['required']
    ); 
    } elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') {
    $this->data['options'][] = array(
    'product_option_id' => $option['product_option_id'],
    'option_id'         => $option['option_id'],
    'name'              => $option['name'],
    'type'              => $option['type'],
    'option_value'      => $option['option_value'],
    'required'          => $option['required']
    ); 
    }
    }
    
    
    if ($product_info['minimum']) {
    $this->data['minimum'] = $product_info['minimum'];
    } else {
    $this->data['minimum'] = 1;
    }
    
    
    $this->data['review_status'] = $this->config->get('config_review_status');
    $this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']);
    $this->data['rating'] = (int)$product_info['rating'];
    $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
    $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
    
    
    $this->data['products'] = array();
    
    
    $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
    
    
    foreach ($results as $result) {
    if ($result['image']) {
    $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
    } else {
    $image = false;
    }
    
    
    if (($this->config->get('config_customer_price') && $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')));
    } 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')));
    } else {
    $special = false;
    }
    
    
    if ($this->config->get('config_review_status')) {
    $rating = (int)$result['rating'];
    } else {
    $rating = false;
    }
    
    
    $this->data['products'][] = array(
    'product_id' => $result['product_id'],
    'thumb'     => $image,
    'name'      => $result['name'],
    'price'     => $price,
    'special'   => $special,
    'rating'     => $rating,
    'reviews'    => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
    'href'      => $this->url->link('product/product', 'product_id=' . $result['product_id'])
    );
    } 
    
    
    $this->data['tags'] = array();
    
    
    if ($product_info['tag']) { 
    $tags = explode(',', $product_info['tag']);
    
    
    foreach ($tags as $tag) {
    $this->data['tags'][] = array(
    'tag'  => trim($tag),
    'href' => $this->url->link('product/search', 'tag=' . trim($tag))
    );
    }
    }
    
    
    $this->model_catalog_product->updateViewed($this->request->get['product_id']);
    
    
    
    
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/product/product.tpl';
    } else {
    $this->template = 'default/template/product/product.tpl';
    }
    
    
    $this->children = array(
    'common/column_left',
    'common/column_right',
    'common/content_top',
    'common/content_bottom',
    'common/footer',
    'common/header'
    );
    
    
    $this->response->setOutput($this->render());
    } else {
    $url = '';
    $this->getChild('error/not_found');
    
    if (isset($this->request->get['path'])) {
    $url .= '&path=' . $this->request->get['path'];
    }
    
    
    if (isset($this->request->get['filter'])) {
    $url .= '&filter=' . $this->request->get['filter'];
    } 
    
    
    if (isset($this->request->get['manufacturer_id'])) {
    $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
    } 
    
    
    if (isset($this->request->get['search'])) {
    $url .= '&search=' . $this->request->get['search'];
    } 
    
    
    if (isset($this->request->get['tag'])) {
    $url .= '&tag=' . $this->request->get['tag'];
    }
    
    
    if (isset($this->request->get['description'])) {
    $url .= '&description=' . $this->request->get['description'];
    }
    
    
    if (isset($this->request->get['category_id'])) {
    $url .= '&category_id=' . $this->request->get['category_id'];
    }
    
    
    if (isset($this->request->get['sub_category'])) {
    $url .= '&sub_category=' . $this->request->get['sub_category'];
    } 
    
    
    if (isset($this->request->get['sort'])) {
    $url .= '&sort=' . $this->request->get['sort'];
    } 
    
    
    if (isset($this->request->get['order'])) {
    $url .= '&order=' . $this->request->get['order'];
    } 
    
    
    if (isset($this->request->get['page'])) {
    $url .= '&page=' . $this->request->get['page'];
    }
    
    
    if (isset($this->request->get['limit'])) {
    $url .= '&limit=' . $this->request->get['limit'];
    }
    
    
           $this->data['breadcrumbs'][] = array(
             'text'      => $this->language->get('text_error'),
    'href'      => $this->url->link('product/product', $url . '&product_id=' . $product_id),
             'separator' => $this->language->get('text_separator')
           ); 
    
    
           $this->document->setTitle($this->language->get('text_error'));
    
    
           $this->data['heading_title'] = $this->language->get('text_error');
    
    
           $this->data['text_error'] = $this->language->get('text_error');
    
    
           $this->data['button_continue'] = $this->language->get('button_continue');
           $this->data['continue'] = $this->url->link('common/home');
    
    
    $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');
    
    
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
    } else {
    $this->template = 'default/template/error/not_found.tpl';
    }
    
    
    $this->children = array(
    'common/column_left',
    'common/column_right',
    'common/content_top',
    'common/content_bottom',
    'common/footer',
    'common/header'
    );
    
    
    $this->response->setOutput($this->render());
         }
       }
    
    
    public function review() {
         $this->language->load('product/product');
    
    
    $this->load->model('catalog/review');
    
    
    $this->data['text_on'] = $this->language->get('text_on');
    $this->data['text_no_reviews'] = $this->language->get('text_no_reviews');
    
    
    if (isset($this->request->get['page'])) {
    $page = $this->request->get['page'];
    } else {
    $page = 1;
    }  
    
    
    $this->data['reviews'] = array();
    
    
    $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
    
    
    $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
           
    foreach ($results as $result) {
             $this->data['reviews'][] = array(
             'author'     => $result['author'],
    'text'       => $result['text'],
    'rating'     => (int)$result['rating'],
             'reviews'    => sprintf($this->language->get('text_reviews'), (int)$review_total),
             'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
             );
           } 
    
    
    $pagination = new Pagination();
    $pagination->total = $review_total;
    $pagination->page = $page;
    $pagination->limit = 5; 
    $pagination->text = $this->language->get('text_pagination');
    $pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');
    
    
    $this->data['pagination'] = $pagination->render();
    
    
    if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/product/review.tpl';
    } else {
    $this->template = 'default/template/product/review.tpl';
    }
    
    
    $this->response->setOutput($this->render());
    }
    
    
    public function write() {
    $this->language->load('product/product');
    
    
    $this->load->model('catalog/review');
    
    
    $json = array();
    
    
    if ($this->request->server['REQUEST_METHOD'] == 'POST') {
    if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {
    $json['error'] = $this->language->get('error_name');
    }
    
    
    if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {
    $json['error'] = $this->language->get('error_text');
    }
    
    
    if (empty($this->request->post['rating'])) {
    $json['error'] = $this->language->get('error_rating');
    }
    
    
    if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
    $json['error'] = $this->language->get('error_captcha');
    }
    
    
    if (!isset($json['error'])) {
    $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
    
    
    $json['success'] = $this->language->get('text_success');
    }
    }
    
    
    $this->response->setOutput(json_encode($json));
    }
    
    
    public function captcha() {
    $this->load->library('captcha');
    
    
    $captcha = new Captcha();
    
    
    $this->session->data['captcha'] = $captcha->getCode();
    
    
    $captcha->showImage();
    }
    
    
    public function upload() {
    $this->language->load('product/product');
    
    
    $json = array();
    
    
    if (!empty($this->request->files['file']['name'])) {
    $filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8')));
    
    
    if ((utf8_strlen($filename) < 3) || (utf8_strlen($filename) > 64)) {
             $json['error'] = $this->language->get('error_filename');
      }    
    
    
    // Allowed file extension types
    $allowed = array();
    
    
    $filetypes = explode("\n", $this->config->get('config_file_extension_allowed'));
    
    
    foreach ($filetypes as $filetype) {
    $allowed[] = trim($filetype);
    }
    
    
    if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) {
    $json['error'] = $this->language->get('error_filetype');
            } 
    
    
    // Allowed file mime types 
       $allowed = array();
    
    
    $filetypes = explode("\n", $this->config->get('config_file_mime_allowed'));
    
    
    foreach ($filetypes as $filetype) {
    $allowed[] = trim($filetype);
    }
    
    
    if (!in_array($this->request->files['file']['type'], $allowed)) {
    $json['error'] = $this->language->get('error_filetype');
    }
    
    
    if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
    $json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
    }
    } else {
    $json['error'] = $this->language->get('error_upload');
    }
    
    
    if (!$json && is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) {
    $file = basename($filename) . '.' . md5(mt_rand());
    
    
    // Hide the uploaded file name so people can not link to it directly.
    $json['file'] = $this->encryption->encrypt($file);
    
    
    move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
    
    
    $json['success'] = $this->language->get('text_upload');
    } 
    
    
    $this->response->setOutput(json_encode($json)); 
    }
    }
    ?>
  10. Я владею php на уровне копипаста, так что описывать константы не умею :)

    Но я вставила в код каждый из вариантов по очереди, и если при 

    $this->load->controller('error/not_found');
    страница просто не открывается, то при

    $this->getChild('error/not_found');
    отображается вот эта жесть: http://www.svet24.su/svetilniki/potolochnye-svetilniki/srs-775-507-01.htm а должно быть так: http://svet24.su/drtfghj

     

    Строку кода вставила сразу после 

    $this->response->setOutput($this->render());
    } else {
    $url = '';
  11. Подскажите, где посмотреть список файлов, которые изменились в 1.5.5.1.2 по сравнению с 1.5.5.1.1 ?

    У меня в сайте много всяких доработок, просто залить новую версию поверх старой не вариант.

     

    Извиняюсь, если уже этот вопрос задавали, я не нашла ответа.

  12. Добрый день!

    У меня окстор 1.5.5.1.1

    Возникла необходимость для отключенного через админку товара отдавать 404 страницу и заголовок сервера.

    С ответом сервера решилось добавлением строки  в контроллер product.php :

    $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found');  

    А как сделать, чтоб кроме 404 заголовка выводилась и сама 404 страница? у меня на ней некоторые модули и другая верстка. как её вывести?

  13. Разбираться в причинах не стали, знакомый разработчик дописал вот это в system/library/response.php Может кому пригодится

     

    if (!headers_sent()) {
    $expshow=true;
    foreach ($this->headers as $header) {
    
    
    if(strpos($header,'xpir')!==FALSE) {
    $expshow=false;
    }
    
    
    header($header, true);
    }
    
    
    if($expshow){
    $dates=gmdate("D, d M Y H:i:s", time()+1) . " GMT";
    header("Expires: " . $dates, true);
    
    
    
    
    }
    • +1 2
  14. Добрый день!

    У меня сервер отдаёт заголовок из прошлого:

    • Expires: Thu, 19 Nov 1981 08:52:00 GMT

     

    В htaccess прописано 

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 10 days"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/plain "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType application/x-icon "access plus 1 year"
    </IfModule>
     
    Что еще сделать, чтобы дата в Expires была актуальная? а то яндекс ругается и выкидывает из индекса
  15. ✕Слишком мелкий шрифт

    ✕Ссылки слишком близко друг к другу

    ✕Не задана область просмотра для мобильных устройств

    ✕Контент шире экрана

    Можно ссылку на сайт?

  16. Яндекс не поддерживает изображения в сайтмапе, это да, но я хочу увеличить трафик из гугл картинок. Т.к. в моей тематике картинки у всех одинаковые, предоставленные поставщиками, то я надеюсь, что прописанные в сайтмапе с тайтлами картинки будут выдаваться по нужным мне запросам. Если поможете прикрутить эту функцию - потом напишу о результатах)

  17. https://www.google.com/webmasters/tools/mobile-friendly/ проверь здесь.

    Возможно, проблема исключительно в том, что гугл не может проиндексировать css и javascript. Если это так, то в этом инструменте твой сайт будет отображаться косо криво) Чтобы открыть индексацию, нужно в роботс.тхт из раздела для гугла убрать строку Disallow: /catalog

    Если дело в другом - то тогда, скорей всего, придётся перевёрстывать сайт под мобильные устройства

    • +1 2
  18. Добрый день! Помогите, пожалуйста!

    Хочу добавить картинки в сайтмап, но в php я полный баран.

    Что дописать сюда (или куда-то ещё)

    $products = $this->model_sitemap_fast_sitemap->getProducts($this->options);
    
    
    foreach ($products as $product) {
    $output .= '<url>';
    $output .= '<loc>' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . '</loc>';
    $output .= '<lastmod>' . substr(max($product['date_added'], $product['date_modified']), 0, 10) . '</lastmod>';
    $output .= '<changefreq>weekly</changefreq>';
    $output .= '<priority>1.0</priority>';
    $output .= '</url>';
    }

    Чтобы на выходе было примерно так:

    <url>
    <loc>http://example.com/tovar.html</loc>
    <image:image>
    <image:loc>http://example.com/image.jpg</image:loc>
    <image:title>Текст из product_description.name</image:title>
    <image:caption>Текст из product_description.name</image:caption>
    </image:image>
    </url> 

     

  19.  

    В контроллере товара после

    $this->data['points'] = $product_info['points'];

    добавляем 

    $this->data['price_not_formatted'] = $product_info['price'];

    и потом в шаблоне используем 

    <?php if ($price_not_formatted > 5000) { ?>то...<?php }>

    Спасибо!  :eek:

  20. Здравствуйте, форумчане! Помогите, пожалуйста.

    Нужно в карточке товара сделать информацию о доставке в зависимости от цены. 

    Я написала вот такую конструкцию (владею php на уровне копипаста), но после её внедрения страница товара не открывается. 

    <div><span>Доставка: </span> 
    <?php if ($price > 5000) { ?>
    <?php echo 'Бесплатно по Москве, по России - транспортными компаниями' ?>
    <?php } else { ?>
    <?php echo '1000 руб. по Москве, по России - транспортными компаниями' }?>
    </div>
    Видимо цена там не в виде числа,а сразу с валютой :( Как мне сделать, чтобы текст менялся в зависимости от цены? 
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.