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

XML ссылки информации в меню


Recommended Posts

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

Посивил модификатор на опенкарт 3, который выводит ситьи из блока ИНФОРМАЦИЯ в пункт меню.

Как сгделать, чтобы выводил не в выпадаюещём меню, а каждая ситья, своей кнопкой?

Код:

 

<file path="catalog/controller/common/menu.php">
        <operation>
            <search><![CDATA[
            return $this->load->view('common/menu', $data);
            ]]></search>
            <add position="before"><![CDATA[
            $this->load->language('common/footer');
            $this->load->model('catalog/information');
            //information
            $children_data = array();
            foreach ($this->model_catalog_information->getInformations() as $result) {
                    $children_data[] = array(
                        'name' => $result['title'],
                        'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
                    );
            }
            $data['categories'][] = array(
                'name'     => $this->language->get('text_information'),
                'children' => $children_data,
                'column'   => 1,
                'href'     => 'javascript:void(0);'
            );
            ]]></add>
        </operation>
    </file>
    
    <file path="catalog/view/theme/*/template/common/menu.twig">
        <operation>
            <search><![CDATA[
            <a href="{{ category.href }}" class="see-all">{{ text_all }} {{ category.name }}</a> </div>
            ]]></search>
            <add position="replace"><![CDATA[
            {% if category.href != 'javascript:void(0);' %}
              <a href="{{ category.href }}" class="see-all">{{ text_all }} {{ category.name }}</a> </div>
            {% endif %}
            ]]></add>
        </operation>
    </file>
</modification>

 

Link to comment
Share on other sites


Узнала свой код :)

https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=10969

возмите етот модификатор

all_information_pages_to_menu_as_top_categories

или

information_pages_NOT_in_footer _to_menu_as_top_categories

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

×
×
  • 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.