Как настроить страницу оформления заказа так, чтобы она открывалась на новой вкладке, сохраняя при этом обычное поведение WooCommerce, когда пользователь нажимает кнопку подтверждения покупки?
Я хочу добавить новый метод к кнопке WooCommerce, чтобы открывается новая вкладка.
Я попробовал это в HTML-блоке Elementor:
document.addEventListener('DOMContentLoaded', function() {
var abrirContratoButton = document.getElementById('place_order');
if (abrirContratoButton) {
abrirContratoButton.addEventListener('click', function(event) {
//event.preventDefault();
var firstName = document.getElementById('billing_first_name').value;
var lastName = document.getElementById('billing_last_name').value;
var cpfCnpj = document.getElementById('billing_cpf_cnpj').value;
localStorage.setItem('billing_first_name', firstName);
localStorage.setItem('billing_last_name', lastName);
localStorage.setItem('billing_cpf_cnpj', cpfCnpj);
window.location.href = abrirContratoButton.getAttribute('href');
});
}
});
Подробнее здесь: https://stackoverflow.com/questions/781 ... oocommerce
Как открыть страницу в новой вкладке после завершения покупки в woocommerce ⇐ Php
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение