Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Перелинковка категорий
- -стили:
- _folder_links.scss
- -скрипты и html:
- для блока с категориями добавляем проверку {if $folder.folder_id == $e.folder_id} active_folder{/if} http://prntscr.com/16aihvz
- добавляем дата-атрибут data-f-name="{$e.folder_name}" http://prntscr.com/16aiahi
- добавляем див, куда будем вставлять перелинковку http://prntscr.com/16ainmy
- {if $mode == "folder" && $page.plugin_id == 16}
- <div class="folders-submenu"></div>
- {/if}
- добавляем скрипт http://prntscr.com/16arwx8
- {literal}
- <script>
- $(function(){
- if (shop2.mode == 'folder') {
- var $active_folder = $('.shop-folders .active_folder'),
- prev_href = $active_folder.prev().find('>a').attr('href'),
- next_href = $active_folder.next().find('>a').attr('href'),
- prev_text = $active_folder.prev().data('f-name'),
- next_text = $active_folder.next().data('f-name');
- if (prev_text) {
- $(".folders-submenu").addClass('no_prev_btn');
- };
- if (next_text) {
- $(".folders-submenu").addClass('no_next_btn');
- };
- var prev_icon = '<i><svg class="gr-svg-icon"><use xlink:href="#icon_shop_card_prev"></use></svg><svg class="gr-svg-icon gr_small_icon"><use xlink:href="#icon_shop_card_prev_small"></use></svg></i>';
- var next_icon = '<i><svg class="gr-svg-icon"><use xlink:href="#icon_shop_card_next"></use></svg><svg class="gr-svg-icon gr_small_icon"><use xlink:href="#icon_shop_card_next_small"></use></svg></i>';
- if (prev_href) {
- var prev_btn = `<a href="${prev_href}" class="folders-submenu__prev"><span>${prev_text}${prev_icon}</span></a>`;
- $(".folders-submenu").append(prev_btn);
- };
- if (next_href) {
- var next_btn = `<a href="${next_href}" class="folders-submenu__next"><span>${next_text}${next_icon}</span></a>`;
- $(".folders-submenu").append(next_btn);
- };
- };
- });
- </script>
- {/literal}
- вот что получим в итоге https://prnt.sc/16as7nv
- и нужно будет проверить адаптацию
- тут можно посмотреть http://gr-shop2-2-130.oml.ru/magazin/folder/pitstsa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement