[Помогите] Исправление отображения производителя

Тема в разделе "OpenCart", создана пользователем MGT1, 19 ноя 2018.

  1. MGT1

    MGT1

    Регистрация:
    5 янв 2013
    Сообщения:
    900
    Симпатии:
    218
    Созданная отдельная схема для производителя


    Одновременно в нем отображается и логотип и Н1, как и в демке, но где-то зарезали код и текст отображается не верно, как на демке:


    если вstylesheet.css изменить в строке 294
    margin: -10px 0px 10px -20px; - отключить, все станет более менее, но нарушит работу на сайте.

    Как поправить бы это?
    --- Добавлено, 19 ноя 2018 ---
    Возможно что-то тянет с паладина
     
  2. chukcha

    chukcha

    Регистрация:
    9 окт 2014
    Сообщения:
    448
    Симпатии:
    119
    Не закоыт тег

    Или даже не в тот тег попало description
     
  3. MGT1

    MGT1

    Регистрация:
    5 янв 2013
    Сообщения:
    900
    Симпатии:
    218
    PHP:
    .category-details{-webkit-border-radius:0px;-moz-border-radius:0px;-khtml-border-radius:0px;border-radius:0px;background-color:#FFF;border-top:5px solid #f5f5f5;border-bottom:10px solid #f5f5f5;padding:10px 20px;-moz-box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);margin-bottom:25px;position:relative;overflow:hidden;}
    .category-details-top{display:table;position:relative;margin:-10px 0px 10px -20px;padding-right:40px;width:100%;border-bottom:1px solid #eee;height:42px;}
    .category-details-top .image{position:relative;background-color:#fff;display:inline-block;float:left;}
    .category-details-top .image img{border-right:1px solid #eee;border-bottom:1px solid #eee;padding:0px 4px;height:42px;width:42px;margin-bottom:-5px;}
    .category-details .category-h1{float:left;padding-left:10px;}
    .
    category-details h1{font-family:"Century Gothic""Trebuchet MS""Helvetica""Arial"sans-serif;line-height:42px;font-size:20px;color:#404040;margin-bottom:0px;}
    .category-details .refine-p{color:#404040;font-size:13px;font-weight:600;padding:5px;margin-top:10px;font-family:"Open Sans", "Helvetica", 'Ubuntu', sans-serif;display:block;border-bottom:1px solid #eee;text-align:center;}
    #bottom-description > .category-info-down{-webkit-border-radius:0px;-moz-border-radius:0px;-khtml-border-radius:0px;border-radius:0px;background-color:#FFF;border-top:5px solid #f5f5f5;border-bottom:10px solid #f5f5f5;padding:10px 20px;-moz-box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);box-shadow:0 2px 3px rgba(0, 0, 0, 0.2);margin:20px 0px 0px;position:relative;}
    #bottom-description > .category-details-top{border-bottom:1px solid #EEEEEE;display:table;height:42px;margin:-10px 0px 10px -20px;padding-right:40px;position:relative;width:100%;}
    #bottom-description > .category-info-down .category-h3{float:left;padding-left:10px;}
    #bottom-description > .category-info-down h3{color:#404040;font-family:"Century Gothic", "Trebuchet MS", "Helvetica", "Arial", sans-serif;font-size:20px;line-height:42px;margin-bottom:0px;margin-top:0px;font-weight:400;}
    #bottom-description > .category-details-top .image{background-color:#FFFFFF;display:inline-block;float:left;position:relative;}
    #bottom-description > category-details-top .image img{border-bottom:1px solid #EEEEEE;border-right:1px solid #EEEEEE;height:42px;margin-bottom:-5px;padding:0px 4px;width:42px;}
     
  4. MGT1

    MGT1

    Регистрация:
    5 янв 2013
    Сообщения:
    900
    Симпатии:
    218
    Вроде все закрыто
    --- Добавлено, 20 ноя 2018 ---
    Вижу неверно отображение manufacturer-info, его почему-то поглотило category-details-top
     
  5. MGT1

    MGT1

    Регистрация:
    5 янв 2013
    Сообщения:
    900
    Симпатии:
    218
    Прописал отдельный стиль
    .manufacturer-description {display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0px;margin-inline-end:0px;float:left;margin-top:0px;margin-bottom:20px;margin-left:20px;}

    стало лучше но все равно не так как в демке
    --- Добавлено, 23 ноя 2018 ---
    Как найти где
    <div class="category-details-top">

    сжирает
    <div class="manufacturer-description">
    --- Добавлено, 23 ноя 2018 ---
    так как на демке они отдельно вынесены
    --- Добавлено, 23 ноя 2018 ---
    Может загвоздка тут?

    PHP:
    <file name="catalog/view/theme/*/template/product/manufacturer_info.tpl">
            <operation error="log">
                <search position="after"><![CDATA[echo $heading_title;]]></search>
                <add><![CDATA[
    <div class="manufacturer-description"><?php if (isset($manufacturer_image) AND $manufacturer_image) { ?><img src="<?php echo $manufacturer_image?>" alt="<?php echo $manufacturer_name?>" class="manufacturer-info-logo" /><?php ?> <?php if ($description) { ?>
    <!-- * = * -->
    <?php if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_h1'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_h1'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    <?php 
    if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'before_description'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'before_description'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    <?php 
    echo $description?><?php ?>
    <?php 
    if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_description'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_description'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    </div> 
    <!-- * = * -->
                ]]></add>
            </operation>
            <operation error="skip">
                <search position="after"><![CDATA[echo $pagination;]]></search>
                <add><![CDATA[
                    <!-- * = * -->
                    <?php if (isset($tags) AND $tags) { ?><div class="tags"><b><?php echo $text_tags?></b><?php for ($i 0$i count($tags); $i++) { ?><?php if ($i < (count($tags) - 1)) { ?><a href="<?php echo $tags[$i]['href'];  ?>"><?php echo $tags[$i]['tag']; ?></a>,<?php } else { ?><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a><?php ?><?php ?></div><?php ?>
                    <!-- * = * -->
                ]]></add>
            </operation>       
        </file>
    --- Добавлено, 23 ноя 2018 ---
    Нет, по-ходу не то
    --- Добавлено, 23 ноя 2018 ---
    Тянет где-то отсюда..

    PHP:
    <file name="catalog/controller/product/category.php">
            <operation error="log">
                <search position="after"><![CDATA[data['text_empty'] = $this->language->get('text_empty');]]></search>
                <add><![CDATA[
                    /* = */
                    if(isset($category_info['seo_h1']) && $category_info['seo_h1']){
                        $this->data['heading_title'] = $category_info['seo_h1'];
                    }
                    if(isset($category_info['seo_h2']) && $category_info['seo_h2']){
                        $this->data['seo_h2'] = $category_info['seo_h2'];
                    }
                    if(isset($category_info['seo_h3']) && $category_info['seo_h3']){
                        $this->data['seo_h3'] = $category_info['seo_h3'];
                    }
                    
                    if(isset($category_info['seo_title']) AND $category_info['seo_title']){
                        require_once DIR_CONFIG .'ssb_library/ssb_data.php';
                        $ssb_data     = ssb_data::getInstance();
                        $tools     = $ssb_data->getSetting('tools');
                        if($page > 1){
                            if($tools['seo_pagination']['data']['add_pag_title']){
                                $category_info['seo_title'] = $category_info['seo_title'] .  ' - page ' . $page;
                            }
                        }   
                        $this->document->setTitle($category_info['seo_title']);
                    }
                    
                    $this->data['tags'] = array();
                    if (isset($category_info['tag']) AND $category_info['tag']) {
                        $tags = explode(',', $category_info['tag']);
                        
                        foreach ($tags as $tag) {
                            $this->data['tags'][] = array(
                                'tag'  => trim($tag),
                                'href' => $this->url->link('product/search', 'tag=' . trim($tag))
                            );
                        }
                    }
                    
                    $this->data['category_alt_image'] = isset($category_info['alt_image']) ? $category_info['alt_image'] : '';
                    $this->data['category_title_image'] = isset($category_info['title_image']) ? $category_info['title_image'] : '';
                    
                    require_once DIR_CONFIG .'ssb_library/ssb_data.php';
                    $this->ssb_data = ssb_data::getInstance();
                    $entity = $this->ssb_data->getSetting('entity');
                    $this->data['seo_h2_position'] = $entity['seo_h2']['category']['position'];
                    $this->data['seo_h3_position'] = $entity['seo_h3']['category']['position'];
                    $tools = $this->ssb_data->getSetting('tools');
                    if($tools){
                        if($tools['if_modified']['data']['category']){
                            $LastModified_unix = strtotime($category_info['date_modified']);
                            $LastModified = gmdate("D, d M Y H:i:s \G\M\T", $LastModified_unix);
                            $IfModifiedSince = false; if (isset($_ENV['HTTP_IF_MODIFIED_SINCE']))   
                            $IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5)); 
                            if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']))   
                            $IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
                            $this->response->addHeader('Last-Modified: '. $LastModified);
                            if ($IfModifiedSince && $IfModifiedSince >= $LastModified_unix){   
                                $head_start = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
                                header($head_start . ' 304 Not Modified');    exit();
                            }
                        }
                        
                        $canonical = $tools['canonical'];
                        if($canonical['status']){
                            $canonical = explode('_', $this->request->get['path']);
                            $canonical = end($canonical);
                            $this->document->addLink($this->url->link('product/category', 'path=' . $canonical ), 'canonical');
                        }
                    }

                    $_SESSION["ssb_page_type"] = 'category';
                    /* = */   
                ]]></add>
            </operation>
            <operation error="log">
                <search position="after"><![CDATA['product_id'  => $result['product_id'],]]></search>
                <add><![CDATA[
                    'title_image'    => isset($result['title_image']) ? $result['title_image'] : '',
                    'alt_image'        => isset($result['alt_image']) ? $result['alt_image'] : '',
                ]]></add>
            </operation>
            <operation error="log">
                <search position="before"><![CDATA[$this->response->setOutput]]></search>
                <add><![CDATA[
                    /* = */
                    if(isset($tools) AND $tools AND $category_info){
                        $set_bread = $tools['seo_breadcrumbs']['data']['category'];
                        $set_add = $tools['seo_breadcrumbs']['data']['additional'];

                        if($set_bread['mode'] != 'default'){
                            require_once DIR_CONFIG .'ssb_library/catalog/tools/bread_and_path.php';
                            $breadAndPath = breadAndPath::getInstance();
                            $this->data['breadcrumbs'] = $breadAndPath->getCategoryBreadcrumb(
                                                                            $category_id,
                                                                            $this->data['breadcrumbs'],
                                                                            $set_bread['mode'],
                                                                            $set_bread['reverse'],
                                                                            $set_add['title'],
                                                                            $set_add['home_to_store']);
                        }
                        
                    }
                    
                    if(isset($_SESSION['seo_page_prev']) AND $_SESSION['seo_page_prev'] != ''){
                        $this->document->addLink($_SESSION['seo_page_prev'],'prev');
                    }
                    if(isset($_SESSION['seo_page_next']) AND $_SESSION['seo_page_next'] != ''){
                        $this->document->addLink($_SESSION['seo_page_next'],'next');
                    }
                    $_SESSION['seo_page_prev'] = '';
                    $_SESSION['seo_page_next'] = '';
                    
                    $this->language->load('product/product');
                    $this->data['text_tags'] = $this->language->get('text_tags');
                    if(isset($data)){
                        $_SESSION["ssb_page_data"] = $this->data;
                    }
                    /* = */
                ]]></add>
            </operation>   
        </file>
        
        <file name="catalog/view/theme/*/template/product/category.tpl">
            <operation error="skip">
                <search regex="true" position="replace"><![CDATA[~<h[123](.*)><\?php echo \$heading_title; \?><\/h[123]>~]]></search>
                <add>
                    <![CDATA[
    <!-- * = * -->
    <h1$1><?php echo $heading_title?></h1>
    <?php if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_h1'){ ?>
    <h2$1><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_h1'){ ?>
    <h3$1><?php echo $seo_h3?></h3><?php ?>
    <!-- * = * -->
                    ]]>
                </add>
            </operation>
            <operation error="skip">
                <search position="before"><![CDATA[<?php if ($description]]></search>
                <
    add>
                    <![
    CDATA[
    <!-- * = * -->
    <?
    php if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'before_description'){ ?>
    <h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'before_description'){ ?>
    <h3><?php echo $seo_h3?></h3><?php ?>
    <!-- * = * -->
                    ]]>
                </add>
            </operation>
            <operation error="log">
                <search position="after"><![CDATA[<?php echo $description?>]]></search>
                <add>
                    <![CDATA[
                    <!-- * = * -->
                        <?php if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_description'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
                        <?php if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_description'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
                    <!-- * = * -->
                    ]]>
                </add>
            </operation>
            <operation error="log">
                <search position="before"><![CDATA[<?php if (!$categories && !$products) { ?>]]></search>
                <add><![CDATA[
    <!-- * = * -->
    <?php if ($products AND isset($tags) AND $tags) { ?><div class="tags gen-area gen-tags"><b><?php echo $text_tags ' '?></b><?php for ($i 0$i count($tags); $i++) { ?><?php if ($i < (count($tags) - 1)) { ?><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>,<?php } else { ?><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a><?php ?><?php ?></div><?php ?>
    <!-- * = * -->
                ]]></add>
            </operation>   
            <operation error="skip">
                <search position="replace"><![CDATA[title="<?php echo $product['name']; ?>"]]></search>
                <add><![CDATA[
                    title="<?php echo $product['title_image'] ? $product['title_image'] : $product['name']; ?>"
                ]]></add>
            </operation>
            <operation error="skip">
                <search position="replace"><![CDATA[alt="<?php echo $product['name']; ?>"]]></search>
                <add><![CDATA[
                    alt="<?php echo $product['alt_image'] ? $product['alt_image'] : $product['name']; ?>"
                ]]></add>
            </operation>
            <operation error="skip">
                <search position="replace">
                    <![CDATA[title="<?php echo $heading_title?>"]]>
                </search>
                <add>
                    <![CDATA[]]>
                </add>
            </operation>
            <operation error="skip">
                <search position="replace">
                    <![CDATA[alt="<?php echo $heading_title?>"]]>
                </search>
                <add>
                    <![CDATA[alt="<?php echo $category_alt_image $category_alt_image $heading_title?>" title="<?php echo $category_title_image $category_title_image $heading_title?>"]]>
                </add>
            </operation>
        </file>
        
        <file name="catalog/controller/product/manufacturer.php">
            <operation error="log">
                <search position="after"><![CDATA[$this->data['heading_title'] = $manufacturer_info['name'];]]></search>
                <add><![CDATA[
                    /* = */
                    if(isset($manufacturer_info['seo_h1']) && $manufacturer_info['seo_h1']){
                        $this->data['heading_title'] = $manufacturer_info['seo_h1'];
                    }
                    if(isset($manufacturer_info['seo_h2']) && $manufacturer_info['seo_h2']){
                        $this->data['seo_h2'] = $manufacturer_info['seo_h2'];
                    }
                    if(isset($manufacturer_info['seo_h3']) && $manufacturer_info['seo_h3']){
                        $this->data['seo_h3'] = $manufacturer_info['seo_h3'];
                    }
                    
                    $this->data['description'] = '';
                    if(isset($manufacturer_info['description']))
                    $this->data['description'] = html_entity_decode($manufacturer_info['description'], ENT_QUOTES, 'UTF-8');
                    $this->document->setDescription($manufacturer_info['meta_description']);
                    $this->document->setKeywords($manufacturer_info['meta_keyword']);
                    
                    if(isset($manufacturer_info['seo_title']) AND $manufacturer_info['seo_title']){
                        if($page > 1){
                            require_once DIR_CONFIG .'ssb_library/ssb_data.php';
                            $ssb_data     = ssb_data::getInstance();
                            $tools     = $ssb_data->getSetting('tools');
                            if($tools['seo_pagination']['data']['add_pag_title']){
                                $manufacturer_info['seo_title'] = $manufacturer_info['seo_title'] .  ' - page ' . $page;
                            }
                        }
                        $this->document->setTitle($manufacturer_info['seo_title']);
                    }
                    $this->data['manufacturer_name'] = $manufacturer_info['name'];
                    if ($manufacturer_info['image']) {
                        $this->data['manufacturer_image'] = $this->model_tool_image->resize($manufacturer_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
                    } else {
                        $this->data['manufacturer_image'] = false;
                    }
                    
                    $this->data['tags'] = array();
                    if (isset($manufacturer_info['tag']) AND $manufacturer_info['tag']) {
                        $tags = explode(',', $manufacturer_info['tag']);
                        
                        foreach ($tags as $tag) {
                            $this->data['tags'][] = array(
                                'tag'  => trim($tag),
                                'href' => $this->url->link('product/search', 'tag=' . trim($tag))
                            );
                        }
                    }
                    
                    require_once DIR_CONFIG .'ssb_library/ssb_data.php';
                    $this->ssb_data = ssb_data::getInstance();
                    $entity = $this->ssb_data->getSetting('entity');
                    $this->data['seo_h2_position'] = $entity['seo_h2']['brand']['position'];
                    $this->data['seo_h3_position'] = $entity['seo_h3']['brand']['position'];
                    $tools = $this->ssb_data->getSetting('tools');
                    if($tools){
                        $canonical = $tools['canonical'];
                        if($canonical['status']){
                            if (isset($this->request->get['manufacturer_id'])){
                                $canonical = $this->request->get['manufacturer_id'];
                                $this->document->addLink($this->url->link('product/manufacturer/info', 'manufacturer_id=' . $canonical), 'canonical');
                            }
                        }
                    }
                    
                    $_SESSION["ssb_page_type"] = 'brand';
                    
                    /* = */
                ]]></add>
            </operation>
            <operation error="log">
                <search position="before"><![CDATA[$this->response->setOutput]]></search>
                <add><![CDATA[
                    /* = */
                    if(isset($_SESSION['seo_page_prev']) AND $_SESSION['seo_page_prev'] != ''){
                        $this->document->addLink($_SESSION['seo_page_prev'],'prev');
                    }
                    if(isset($_SESSION['seo_page_next']) AND $_SESSION['seo_page_next'] != ''){
                        $this->document->addLink($_SESSION['seo_page_next'],'next');
                    }
                    $_SESSION['seo_page_prev'] = '';
                    $_SESSION['seo_page_next'] = '';
                    
                    $this->language->load('product/product');
                    $this->data['text_tags'] = $this->language->get('text_tags');
                    if(isset($data)){
                        $_SESSION["ssb_page_data"] = $this->data;
                    }
                    /* = */
                ]]></add>
            </operation>
        </file>
        
        <file name="catalog/model/catalog/manufacturer.php">
            <operation error="log">
                <search position="before"><![CDATA[return $query->row;]]></search>
                <add><![CDATA[
                    /* = */
                    $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "manufacturer m LEFT JOIN " . DB_PREFIX . "manufacturer_to_store m2s ON (m.manufacturer_id = m2s.manufacturer_id) LEFT JOIN " . DB_PREFIX . "manufacturer_description m_d ON (m.manufacturer_id = m_d.manufacturer_id AND m_d.language_id = '" . (int)$this->config->get('config_language_id') . "') WHERE m.manufacturer_id = '" . (int)$manufacturer_id . "' AND m2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
                    /* = */
                ]]></add>
            </operation>
        </file>
        
        <file name="catalog/view/theme/*/template/product/manufacturer_info.tpl">
            <operation error="log">
                <search position="after"><![CDATA[echo $heading_title;]]></search>
                <add><![CDATA[
    <!-- * = * -->
    <?php if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_h1'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_h1'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    <div class="manufacturer-description"><?php if (isset($manufacturer_image) AND $manufacturer_image?> <?php if ($description) { ?>
    <?php 
    if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'before_description'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'before_description'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    <?php 
    echo $description?><?php ?>
    <?php 
    if(isset($seo_h2) && $seo_h2 && $seo_h2_position == 'after_description'){ ?><h2><?php echo $seo_h2?></h2><?php ?>
    <?php 
    if(isset($seo_h3) && $seo_h3 && $seo_h3_position == 'after_description'){ ?><h3><?php echo $seo_h3?></h3><?php ?>
    </div> 
    <!-- * = * -->
                ]]></add>
            </operation>
            <operation error="skip">
                <search position="after"><![CDATA[echo $pagination;]]></search>
                <add><![CDATA[
                    <!-- * = * -->
                    <?php if (isset($tags) AND $tags) { ?><div class="tags"><b><?php echo $text_tags?></b><?php for ($i 0$i count($tags); $i++) { ?><?php if ($i < (count($tags) - 1)) { ?><a href="<?php echo $tags[$i]['href'];  ?>"><?php echo $tags[$i]['tag']; ?></a>,<?php } else { ?><a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a><?php ?><?php ?></div><?php ?>
                    <!-- * = * -->
                ]]></add>
            </operation>       
        </file>