<style>
/*
* Кастомные стили для блока с сообщением об успешной активации промокода.
* Вы можете менять значения (цвета, отступы) под дизайн вашего сайта.
*/
.t-inputpromocode__wrapper .t-text {
background-color: #E8F5E9 !important; /* Светло-зеленый фон */
color: #1B5E20 !important; /* Темно-зеленый цвет текста */
padding: 5px !important; /* Внутренние отступы для "воздуха" */
border-radius: 8px !important; /* Скругление углов */
border: 1px solid #A5D6A7 !important; /* Тонкая зеленая рамка */
margin-top: 15px !important; /* Отступ сверху от полей ввода */
text-align: center !important; /* Выравнивание текста по центру */
}
</style>
<script>
t_onReady(function() {
try {
t_onFuncLoad('t_input_promocode_init', function() {
document.querySelectorAll('.auto-promo-button').forEach(function(button) {
button.addEventListener('click', function(event) {
// Здесь укажите ваш промокод, который нужно автоактивировать
var promoCode = 'ASDFA23LKJ2';
var promoInput = document.querySelector('input.t-inputpromocode');
if (promoInput) {
promoInput.value = promoCode;
var activateBtn = document.querySelector('.t-inputpromocode__btn');
if (activateBtn) {
activateBtn.style.display = 'table-cell';
}
var inputEvent = new Event('input', { bubbles: true });
promoInput.dispatchEvent(inputEvent);
setTimeout(function() {
activateBtn.click();
}, 500);
}
});
});
});
} catch (error) {
console.error('Ошибка автоактивации промокода:', error);
}
});
</script>