Всем привет, в этой статье мы с вами переделаем подвал (footer) стандартного шаблона от CMS OpenCart 4.1.0.0. — удалим лишние ссылки, уменьшим высоту, добавим адрес и ссылки на телефон и почту. В общем сделаем всё минималистично и симпатично.
1. Откроем файл: ../catalog/view/template/common/footer.twig и вместо этих строк:
<footer> <div class="container"> <div class="row"> {% if informations or blog %} <div class="col-sm-3"> <h5>{{ text_information }}</h5> <ul class="list-unstyled"> {% if blog %} <li><a href="{{ blog }}">{{ text_blog }}</a></li> {% endif %} {% for information in informations %} <li><a href="{{ information.href }}">{{ information.title }}</a></li> {% endfor %} </ul> </div> {% endif %} <div class="col-sm-3"> <h5>{{ text_service }}</h5> <ul class="list-unstyled"> <li><a href="{{ contact }}">{{ text_contact }}</a></li> <li><a href="{{ return }}">{{ text_return }}</a></li> {% if gdpr %} <li><a href="{{ gdpr }}">{{ text_gdpr }}</a></li> {% endif %} <li><a href="{{ sitemap }}">{{ text_sitemap }}</a></li> </ul> </div> <div class="col-sm-3"> <h5>{{ text_extra }}</h5> <ul class="list-unstyled"> <li><a href="{{ manufacturer }}">{{ text_manufacturer }}</a></li> {% if affiliate %} <li><a href="{{ affiliate }}">{{ text_affiliate }}</a></li> {% endif %} <li><a href="{{ special }}">{{ text_special }}</a></li> </ul> </div> <div class="col-sm-3"> <h5>{{ text_account }}</h5> <ul class="list-unstyled"> <li><a href="{{ account }}">{{ text_account }}</a></li> <li><a href="{{ order }}">{{ text_order }}</a></li> <li><a href="{{ wishlist }}">{{ text_wishlist }}</a></li> <li><a href="{{ newsletter }}">{{ text_newsletter }}</a></li> </ul> </div> </div> <hr> <p>{{ powered }}</p> <!-- OpenCart is open source software and you are free to remove the powered by OpenCart if you want, but its generally accepted practise to make a small donation. Please donate via PayPal to donate@opencart.com //--> </div> </footer>
вставим эти:
<footer> <div class="container"> <div class="row"> {% if informations or blog %} <div class="col-sm-12 col-md-9"> <ul class="line-link"> {% if blog %} <li><a href="{{ blog }}">{{ text_blog }}</a></li> {% endif %} {% for information in informations %} <li><a href="{{ information.href }}">{{ information.title }}</a></li> {% endfor %} <li><a href="{{ manufacturer }}">{{ text_manufacturer }}</a></li> <li><a href="{{ special }}">{{ text_special }}</a></li> <li><a href="{{ contact }}">{{ text_contact }}</a></li> </ul> </div> {% endif %} <div class="col-sm-12 col-md-3"> <ul class="list-unstyled"> <li><i class="fa-solid fa-phone"></i> <a href="tel:{{ phone }}">{{ text_phone }}</a></li> <li><i class="fa-solid fa-envelope"></i><a href="mailto:{{ text_mail }}">{{ text_mail }}</a></li> <li><i class="fa-solid fa-location-dot"></i> {{ text_address }}</li> </ul> </div> </div> <hr> <div class="row"> <div class="col-sm-12">{{ powered }}</div> </div> </div> </footer>
2. Откроем файл: ../catalog/language/ru-ru/default.php и после этой строки:
$_['text_years_ago'] = '%s года назад';
вставим эти:
// Footer Contacts $_['text_phone'] = '+7(925)206-20-98'; $_['text_mail'] = 'hruhru.87@mail.ru'; $_['text_address'] = 'Москва, "ТЦ БарыжкинДвор", павильон 007'; $_['phone'] = '+79252062098';
P.S. — Разумеется указываем свои данные. 🙂
3. Откроем файл: ../catalog/language/en-gb/default.php и после этой строки:
$_['text_years_ago'] = '%s years ago';
вставим эти:
// Footer Contacts $_['text_phone'] = '+7(925)206-20-98'; $_['text_mail'] = 'hruhru.87@mail.ru'; $_['text_address'] = 'Moscow, Baryzhkindvor Shopping Center, pavilion 007'; $_['phone'] = '+79252062098';
4. Откроем файл: ../catalog/view/stylesheet/stylesheet.css и в конец файла вставим эти строки:
.line-link { display: flex; list-style: none; margin: 0; padding: 0; } .line-link li { padding: 0 15px 0 0; } .line-link li a { font-size: 13px; text-transform: uppercase; } footer { padding: 30px 0 50px; }
Чистим все кеши и смотрим результат проделанной работы:
Демонстрационный сайт: demo.moushe.ru (демо сайт обновляется вместе с выходом новых статей).
На сегодня всё, до новых встреч.