cirip
Пользователь
- Сообщения
- 2
- Реакции
- 0
Всем привет. Сделал HTML код и ставлю его в статью, но OpenCart его не сохраняет. Подскажите пожалуйста, как можно поставить HTML код в саму статью?
Делал через модуль HTML контент но не могу понять как поставить этот модуль в статью
Делал через модуль HTML контент но не могу понять как поставить этот модуль в статью
Код:
<!-- ============================================================ -->
<!-- СТАТЬЯ: ДОСТАВКА И ОПЛАТА (OpenCart 3 + Mobile) -->
<!-- ============================================================ -->
<style>
/* ---------- ОБЩИЕ СТИЛИ ---------- */
.delivery-article {
font-family: 'Segoe UI', Roboto, Arial, sans-serif;
color: #2d3436;
max-width: 1200px;
margin: 0 auto;
padding: 10px 0;
}
.delivery-article * {
box-sizing: border-box;
}
/* ---------- ШАПКА ---------- */
.delivery-article .article-header {
text-align: center;
margin-bottom: 30px;
padding-bottom: 18px;
border-bottom: 3px solid #f0f0f0;
}
.delivery-article .article-header h1 {
font-size: 28px;
font-weight: 700;
color: #1a2634;
margin: 0 0 4px 0;
letter-spacing: -0.3px;
}
.delivery-article .article-header p {
font-size: 16px;
color: #636e72;
margin: 0;
}
.delivery-article .article-header .divider {
width: 60px;
height: 4px;
background: #0984e3;
border-radius: 4px;
margin: 12px auto 0;
}
/* ---------- ЗАГОЛОВКИ СЕКЦИЙ ---------- */
.delivery-article .section-title {
font-size: 20px;
font-weight: 600;
color: #1a2634;
margin: 28px 0 16px 0;
padding-bottom: 10px;
border-bottom: 2px solid #ecf0f1;
display: flex;
align-items: center;
gap: 10px;
}
.delivery-article .section-title .icon {
font-size: 24px;
}
/* ---------- АККОРДЕОН (СПОЙЛЕРЫ) ---------- */
.delivery-article .accordion {
margin-bottom: 8px;
border: 1px solid #e9edf0;
border-radius: 14px;
overflow: hidden;
background: #fafbfc;
}
.delivery-article .accordion-header {
background: #fafbfc;
padding: 14px 18px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 600;
font-size: 17px;
color: #1a2634;
transition: background 0.2s;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.delivery-article .accordion-header:hover {
background: #f0f4f8;
}
.delivery-article .accordion-header .arrow {
font-size: 18px;
transition: transform 0.3s ease;
color: #0984e3;
}
.delivery-article .accordion.active .accordion-header .arrow {
transform: rotate(180deg);
}
.delivery-article .accordion-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.4s ease, padding 0.3s ease;
padding: 0 18px;
background: #ffffff;
}
.delivery-article .accordion.active .accordion-body {
max-height: 800px;
padding: 16px 18px 20px;
}
/* ---------- ОПЦИИ ДОСТАВКИ ВНУТРИ АККОРДЕОНА ---------- */
.delivery-article .delivery-option {
background: #f8f9fa;
border-radius: 12px;
padding: 12px 14px;
margin-bottom: 10px;
border: 1px solid #e9edf0;
}
.delivery-article .delivery-option:last-child {
margin-bottom: 0;
}
.delivery-article .delivery-option .option-row {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
font-weight: 600;
color: #1a2634;
font-size: 15px;
}
.delivery-article .delivery-option .option-row .price {
color: #0984e3;
font-weight: 700;
font-size: 16px;
white-space: nowrap;
}
.delivery-article .delivery-option .option-time {
font-size: 14px;
color: #636e72;
margin-top: 3px;
}
.delivery-article .delivery-option .option-time .highlight-time {
color: #1a2634;
font-weight: 600;
}
.delivery-article .delivery-option .option-note {
display: block;
font-size: 12px;
color: #b2bec3;
margin-top: 2px;
}
/* ---------- АНИМАЦИЯ ПРИ ОТКРЫТИИ ---------- */
.delivery-article .accordion-body {
transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}
</style>
<!-- ============================================================ -->
<!-- JAVASCRIPT ДЛЯ АККОРДЕОНА -->
<!-- ============================================================ -->
<script>
function toggleAccordion(header) {
var accordion = header.closest('.accordion');
if (!accordion) return;
// Закрываем все остальные аккордеоны (опционально — для "один открыт")
var allAccordions = document.querySelectorAll('.delivery-article .accordion');
allAccordions.forEach(function(item) {
if (item !== accordion) {
item.classList.remove('active');
}
});
// Переключаем текущий
accordion.classList.toggle('active');
}
// Автоматически открываем первый аккордеон при загрузке (если не active)
document.addEventListener('DOMContentLoaded', function() {
var firstAccordion = document.querySelector('.delivery-article .accordion');
if (firstAccordion && !firstAccordion.classList.contains('active')) {
firstAccordion.classList.add('active');
}
});
</script>
<!-- ============================================================ -->
<!-- КОНЕЦ СТАТЬИ -->
<!-- ============================================================ -->