Just123i Posted September 26, 2012 Report Share Posted September 26, 2012 Скриншот:Установка:1. В шаблон cart.tpl добавить: {literal} <script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> <script> function initialize() { var input = document.getElementById('searchTextField'); var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.bindTo('bounds', map); var infowindow = new google.maps.InfoWindow(); var marker = new google.maps.Marker({ map: map }); } google.maps.event.addDomListener(window, 'load', initialize); </script> {/literal}2. Найти: <label>Адрес доставки</label> <input name="address" type="text" value="{$address|escape}" /> и заменить на: <label>Адрес доставки</label> <input id="searchTextField" name="address" type="text" value="{$address|escape}" /> Другими словами, просто прописать id="searchTextField" соответствующему полю. Quote Link to post Share on other sites
Danya Posted September 27, 2012 Report Share Posted September 27, 2012 спасибо большое! Quote Link to post Share on other sites
Just123i Posted September 27, 2012 Author Report Share Posted September 27, 2012 Всегда пожалуйста! Доработок много планируется, буду стараться чаще делиться наработками. Quote Link to post Share on other sites
Genfon Posted October 28, 2012 Report Share Posted October 28, 2012 Супер. Автору низкий поклон. Quote Link to post Share on other sites
Smith Posted October 29, 2012 Report Share Posted October 29, 2012 Спасибо, работает супер. Quote Link to post Share on other sites
Just123i Posted October 29, 2012 Author Report Share Posted October 29, 2012 Всегда пожалуйста! Будет еще много доработок, как только с бизнес-процессами разберусь, займусь вплотную разработкой и постараюсь большую часть выкладывать бесплатно на форум. Quote Link to post Share on other sites
calvin Posted October 29, 2012 Report Share Posted October 29, 2012 А как сделать, чтобы ещё индекс был? Quote Link to post Share on other sites
Just123i Posted October 29, 2012 Author Report Share Posted October 29, 2012 А как сделать, чтобы ещё индекс был?Автоматически? Или поле чтобы вручную вписать?Если вручную, то нужно добавить input в форму, ну и в базе столбец соответствующий создать. Делать по аналогии с другими полями, ничего сложного в принципе. Quote Link to post Share on other sites
calvin Posted October 30, 2012 Report Share Posted October 30, 2012 Да нет, я имел ввиду автоматически - по адресу ... Quote Link to post Share on other sites
Just123i Posted October 30, 2012 Author Report Share Posted October 30, 2012 Автоматически уже сложнее, но я наверное буду реализовывать это, если сделаю, поделюсь решением. Quote Link to post Share on other sites
RodgerFox Posted October 30, 2012 Report Share Posted October 30, 2012 Надо посмотреть есть же готовые базы с адрессами, найти где с индексами посмотреть как они взаимодействуют и использовать. В этом примере взята база от гугла. Можно найти статическую и запилить на сайт. Как то так ~_~ Quote Link to post Share on other sites
Just123i Posted November 1, 2012 Author Report Share Posted November 1, 2012 Ну, как это реализовать, я уже знаю, просто на данный момент мне это не актуально, поэтому еще не принялся за реализацию.Единственная сложность, это формат адреса которые пишут покупатели, зачастую пишут с ошибками, непопулярными сокращениями и т.д. но автодополнение по идее решает эту проблему.В принципе, готов взяться за реализацию, срок ориентировочно 2-3 дня максимум, если кому-то интересно, можем обсудить бюджет.Можно и как коллективную покупку, так и по отдельности, в общем рассмотрю любые условия. Quote Link to post Share on other sites
artbe Posted May 17, 2013 Report Share Posted May 17, 2013 В шаблон cart.tpl добавить: {literal} <script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script> <script> function initialize() { var input = document.getElementById('searchTextField'); var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.bindTo('bounds', map); var infowindow = new google.maps.InfoWindow(); var marker = new google.maps.Marker({ map: map }); } google.maps.event.addDomListener(window, 'load', initialize); </script> {/literal} 2. Найти: <label>Адрес доставки</label> <input name="address" type="text" value="{$address|escape}" /> и заменить на: <label>Адрес доставки</label> <input id="searchTextField" name="address" type="text" value="{$address|escape}" /> Quote Link to post Share on other sites
Mike C. Posted October 12, 2013 Report Share Posted October 12, 2013 Решение приятное, сейчас установил, посмотрим как работает, будут нарекания отпишусь, а так спасибо! Quote Link to post Share on other sites
Booster Posted October 20, 2013 Report Share Posted October 20, 2013 А реально вообще привязать классификатор адресов КЛАДР к адресному полю как на многих сайтах?http://www.gnivc.ru/inf_provision/classifiers_reference/kladr/ Quote Link to post Share on other sites
Just074 Posted December 12, 2013 Report Share Posted December 12, 2013 Вполне реально, ничего не буду обещать т.к. не известно пока как будут складываться обстоятельства, но скорее всего в ближайшие 2-3 месяца сделаю с использованием КЛАДР и так же выложу в общий доступ. P.S. Если не хочется ждать, то можно простимулировать разработку финансово, возможна так же групповая покупка, цену предлагайте сами, я гибко подхожу к условиям работы. Quote Link to post Share on other sites
LUN Posted December 12, 2013 Report Share Posted December 12, 2013 Реально добавить дополнительные поля "Дом" и "Квартира" ? Quote Link to post Share on other sites
Kosjak76 Posted December 12, 2013 Report Share Posted December 12, 2013 С автозаполнением по базам ФСБ, СБУ и Деда Мороза??? Quote Link to post Share on other sites
Dadata Posted December 24, 2013 Report Share Posted December 24, 2013 Вот здесь есть скрипт для подключения ввода адреса одной строкой в форме с автоматическим разбором его по свежему КЛАДР: http://dadata.ru/suggestions/ Quote Link to post Share on other sites
atatat Posted January 16, 2014 Report Share Posted January 16, 2014 Вот здесь есть скрипт для подключения ввода адреса одной строкой в форме с автоматическим разбором его по свежему КЛАДР: http://dadata.ru/suggestions/А как его подключить к Simpla? Quote Link to post Share on other sites
atatat Posted January 16, 2014 Report Share Posted January 16, 2014 Just123i, спасибо большое!!! Quote Link to post Share on other sites
JoinAuto Posted February 10, 2014 Report Share Posted February 10, 2014 Поставил в 2 клика, супер! Quote Link to post Share on other sites
Vice Posted February 20, 2014 Report Share Posted February 20, 2014 А есть какой-то способ при выборе адреса убрать заполнение страны и города дважды? http://prntscr.com/2u7l42Спасибо за код! Quote Link to post Share on other sites
alexandrbt Posted February 21, 2014 Report Share Posted February 21, 2014 А есть какой-то способ при выборе адреса убрать заполнение страны и города дважды? http://prntscr.com/2u7l42Спасибо за код! У Вас там остался кусочек кода <input name="address" type="text" value="{$address|escape}"/> Его необходимо удалить Quote Link to post Share on other sites
Vice Posted February 22, 2014 Report Share Posted February 22, 2014 Спасибо, alexandrbt! 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.