KoVaLsKy 59 Posted April 14, 2016 Report Share Posted April 14, 2016 Ну что? Полечим пикпоинт и быстрое оформление заказа? Погнали: открываем lang/... pickpoint.php меняем js функцию pickpoint_callback_function на function pickpoint_callback_function(result){ var pickpoint_id = document.getElementById("pickpoint_id"); var pickpoint_address = document.getElementById("pickpoint_address"); var to_pickpoint_id = document.getElementById("to_pickpoint_id"); var to_pickpoint_address = document.getElementById("to_pickpoint_address"); var pickpoint_address_text = document.getElementById("pickpoint_address_text"); var pickpoint_link = document.getElementById("pickpoint_link"); var pickpoint_error = document.getElementById("pickpoint_error"); var pickpoint_link_help = document.getElementById("pickpoint_link_help"); pickpoint_id.value = result["id"]; pickpoint_address.value = result["address"]; to_pickpoint_id.value = result["id"]; to_pickpoint_address.value = result["address"]; // textContent innerHTML pickpoint_address_text.innerHTML = "'.MODULE_SHIPPING_PICKPOINT_TEXT_ADDRESS.'" + result["address"] + " "; pickpoint_link.innerHTML = "'.MODULE_SHIPPING_PICKPOINT_TEXT_ANOTHER_ADDRESS.'"; if (pickpoint_error) pickpoint_error.innerHTML=""; // if (pickpoint_link_help) pickpoint_link_help.innerHTML=""; } Открываем шаблон быстрого оформления заказа module/checkout.html вставляем над <div id="shipping_modules_box" class="sm_layout_box" <input type="hidden" name="to_pickpoint_id" id="to_pickpoint_id" value=""> <input type="hidden" name="to_pickpoint_address" id="to_pickpoint_address" value=""> открываем includes/checkout.js.php после инициализации jQuery вставляем (2 места) function point(){ var adrr = $('#to_pickpoint_address').val(); var vall = $('#to_pickpoint_id').val(); $('#pickpoint_address_text').html('Ваш заказ доставят по адресу: '+adrr); $('#shipping_options').find('#pickpoint_id').remove(); $('#shipping_options').find('#pickpoint_address').remove(); $('#pickpoint_address_text').before('<input type="hidden" name="pickpoint_id" id="pickpoint_id" value="'+vall+'">'); $('#pickpoint_address_text').before('<input type="hidden" name="pickpoint_address" id="pickpoint_address" value="'+adrr+'">'); } далее в .on .... function (){ добавляем point(); т.е получится (просто пример 1го места) $('#box') .on('refresh', '#shipping_modules_box', function(){ $('#shipping_options').load(url +' #shipping_options > *', {'country': $('select[name=country]').val(),'state': $('select[name=state]').val(),'postcode': $('input[name=postcode]').val(),'city': $('input[name=city]').val()}),img_loader(); point(); }) .on('refresh', '#shipping_modules_box', function(){ $('#payment_options').load(url +' #payment_options > *', {'country': $('select[name=country]').val(),'state': $('select[name=state]').val(),'postcode': $('input[name=postcode]').val(),'city': $('input[name=city]').val()}),img_loader(); point(); }) .on('refresh', '#shipping_modules_box', function(){ $('#order_total_modules').load(url +' #order_total_modules > *', {'shipping': $('input[name=shipping]:checked').val(),'payment': $('input[name=payment]:checked').val()}),img_loader(); point(); }) сохраняем - наслаждаемся. Адрес доставки фиксируется корректно Все добра Quote Link to post Share on other sites
support 434 Posted April 14, 2016 Report Share Posted April 14, 2016 Спасибо. Хотя вот вроде попробовал, в итоговых суммах внизу всё равно адрес не подставляется. Quote Link to post Share on other sites
KoVaLsKy 59 Posted April 14, 2016 Author Report Share Posted April 14, 2016 19 минуту назад, VaM сказал: Спасибо. Хотя вот вроде попробовал, в итоговых суммах внизу всё равно адрес не подставляется. да. не подставится. Но далее используется. Quote Link to post Share on other sites
support 434 Posted April 14, 2016 Report Share Posted April 14, 2016 Понятно. Проверю, может по умолчанию в следующей версии добавлю в VamShop. В любом случае, спасибо. Quote Link to post Share on other sites
KoVaLsKy 59 Posted April 14, 2016 Author Report Share Posted April 14, 2016 2 часа назад, VaM сказал: Понятно. Проверю, может по умолчанию в следующей версии добавлю в VamShop. В любом случае, спасибо. если допилю - напишу что и как. Quote Link to post Share on other sites
support 434 Posted April 14, 2016 Report Share Posted April 14, 2016 Хорошо Quote Link to post Share on other sites
KoVaLsKy 59 Posted April 14, 2016 Author Report Share Posted April 14, 2016 еще в js файл добавил $('#pickpoint').click(function(){pickpoint_call();}); что бы "точка" ставилась при нажатии "выбрать адрес" Quote Link to post Share on other sites
support 434 Posted January 22, 2017 Report Share Posted January 22, 2017 Спасибо, добавил данную правку в текущий код. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.