✏️ 正在编辑: front.js
路径:
/home/bpioifn/www/pigmentse/modules/axepta/views/js/front.js
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
/** * 1961-2022 BNP Paribas * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author WE+ <contact@we-plus.fr> * @copyright 1961-2022 BNP Paribas * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * * Don't forget to prefix your containers with your own identifier * to avoid any conflicts with others containers. */ $(document).ready(function () { var btn_validate_order = $('#payment-confirmation input[type=submit]'); var btn_more_options_default_label = $('#axepta-paygates-list .more-option-btn').html(); var option_id; // Delete CGV + Order Button if (!is_logged && is_recurring) { $('#conditions-to-approve').remove(); $('#payment-confirmation').remove(); } function getOptionId() { let div_parent = $('#axepta-paygates-list').parent('div.additional-information'); let split = div_parent.prop('id').split('-additional-information'); option_id = split[0]; } getOptionId(); var form_div = $('#pay-with-' + option_id + '-form'); // Init replaceFormToSend($('.paygate-box.selected').find('form')); // Show more options $('#axepta-paygates-list .more-option-btn').on('click', function () { var is_selected = $(this).hasClass('selected'); if (is_selected) { $(this).removeClass('selected'); $('#more-paygates').slideUp('500'); $(this).html(btn_more_options_default_label); } else { $(this).addClass('selected'); $('#more-paygates').slideDown('500'); $(this).html($(this).data('expended-content')); } }); // Events radio button $('#axepta-paygates-list div.radio').on('mouseleave', function (e) { $(this).addClass('hover'); }); $('#axepta-paygates-list .paygate-box, #axepta-paygates-list .registered_card-box').on('hover', function () { $(this).find('div.radio').addClass('hover'); }); $('#axepta-paygates-list .paygate-box, #axepta-paygates-list .registered_card-box').on('mouseleave', function () { $(this).find('div.radio').removeClass('hover'); }); $('#axepta-paygates-list .paygate-box, #axepta-paygates-list .registered_card-box').on('click', function () { // Remove checked input $('#axepta-paygates-list div.radio').find('span.checked').removeClass('checked'); $('#axepta-paygates-list input:checked').prop('checked', false); $('#axepta-paygates-list div.selected').removeClass('selected'); // Add new checked input $(this).find('input').parent('span').addClass('checked'); $(this).find('input').prop('checked', true); $(this).addClass('selected'); $(btn_validate_order).prop('disabled', false); // Set new Form replaceFormToSend($(this).find('form')); }); // Register Card - OneClick $('#axepta-paygates-list #register_card').prop("checked", false); $("#axepta-paygates-list #register_card").click(function () { let checked = false; if ($('#axepta-paygates-list #register_card').prop("checked") == true) { checked = true; } $('form[data-form=axepta] .checkbox_form').val(checked); }); $(btn_validate_order).on('click', function (e) { e.preventDefault(); e.stopPropagation(); // let input_checked = $('#axepta-paygates-list input:checked'); let input_checked = $('#axepta-paygates-list div.radio span.checked'); if (input_checked.length > 0) { let form = $(input_checked).parents('div.selected').find('form'); form.submit(); } }); // Select Axepta paygate if Axepta is the only one if ($('div.payment-option').length == 1 && $('#axepta-paygates-list').length != 0) { $('#payment-option-1').trigger('click'); } // Taken from old front-js // Don't know if usefull if ($(".form_BOL")[0]) { on_click_event = $(".form_BOL")[0].outerHTML; $(".form_BOL").prop("onclick", null).off("click"); } $(".form_BOL").click(function () { if ($("#security_social_number").val() == '') { alert('You should enter a number of security social'); } }) $("#security_social_number").keyup(function () { if ($("#security_social_number").val() != "") { $("#validate_security_social_number").prop("disabled", false); } else { $("#validate_security_social_number").prop("disabled", true); } }); function replaceFormToSend(selected_form) { let cloned_form = $(selected_form).clone(); form_div.html(cloned_form); } });
💾 保存文件
← 返回文件管理器