Сейчас узнаем, какой подарок выпадет именно Вам
Крутите колесо
Как после отправки формы сразу перейти в платёжную систему используя блок ST105
Stay in the loop with occasional updates
Get new ideas, small insights, and product news, delivered in a clean format you can skim in a minute, with a short recap of what changed and why it matters, plus links to explore the details when you have time.

Как после отправки формы сразу перейти в платёжную систему используя блок ST105, минуя корзину в Tilda

1
Создали блок с формой и задали ему класс uc-form-pay
2
Вставили код в блок Т123
В коде заменили название и цену товара
"Хочу трансформироваться"
"7000"
Mo-ti Level Up
Видео инструкции по добавлению кода и работе с Zero Block.
Как после отправки формы сразу перейти в платёжную систему используя блок ST105
Фрагмент видео
Библиотека для примера
<script>
(function() {
    const productName = "Хочу трансформироваться"; 
    const productSumm = "7000";

    function switchingPaymentSystem(form) {
        const tempLink = document.createElement('a');
        tempLink.href = `#order:${productName}=${productSumm}`;
        
        const container = document.querySelector('.uc-form-pay');
        if (container) {
            container.appendChild(tempLink);
            tempLink.click();
            container.removeChild(tempLink);
        }
    }

    function us_sendFormAfterSuccess() {
        var forms = document.querySelectorAll('.uc-form-pay .js-form-proccess');
        Array.prototype.forEach.call(forms, function (form) {
            form.addEventListener('tildaform:aftersuccess', function () {
                switchingPaymentSystem(form);
            });
        });
    }

    if (document.readyState !== 'loading') {
        us_sendFormAfterSuccess();
    } else {
        document.addEventListener('DOMContentLoaded', us_sendFormAfterSuccess);
    }
})();
</script>


<style>
.js-payment-systembox {
    position: fixed !important;
    top: 0% !important;
    left: 0% !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    background-color: rgb(0 0 0 / 70%);
    pointer-events: none;
}

.js-payment-systembox .js-dropdown-paysystem {
    width: max-content;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: all;
}    
</style>


Библиотека для ZeroBlock (при одной системе оплаты)
Форме задали класс  form-pay
<script>
const productName = "Хочу трансформироваться"; 
const productSumm = "7000";

function t396_onSuccess(form) {
    if (form?.closest('.form-pay')) { 
        const tempLink = document.createElement('a');
        tempLink.href = `#order:${productName}=${productSumm}`;
        
        const container = document.querySelector('.form-pay');
        if (container) {
            container.appendChild(tempLink);
            tempLink.click();
            container.removeChild(tempLink);
        }
    }
}
</script>


<style>
.js-payment-systembox {
    position: fixed !important;
    top: 0% !important;
    left: 0% !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    background-color: rgb(0 0 0 / 70%);
    pointer-events: none;
}

.js-payment-systembox .js-dropdown-paysystem {
    width: max-content;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: all;
}    
</style>


Made on
Tilda