diff --git a/mod/basket/order-form.html b/mod/basket/order-form.html index 3fa0b9e..66e7943 100644 --- a/mod/basket/order-form.html +++ b/mod/basket/order-form.html @@ -3,7 +3,6 @@
{if $orderfields} - {assign var='fieldscount' value=sizeof($orderfields)}
{foreach from=$orderfields item=item name=fieldscounter} {if $item.editable eq 'true'} @@ -46,7 +45,7 @@ {if $order_fields[$item.name]['error']} Обязательно для заполнения{/if}
- + @@ -56,20 +55,20 @@ serviceUrl: "https://dadata.ru/api/v2/suggest/address", type: "ADDRESS", token: "b94c274fc11fbd3fa9f26c57047e57d0287ab91f", - /* Вызывается, когда пользователь выбирает одну из подсказок */ - onSelect: function(suggestion) { - if($('#inputPostindex').length) - $('#inputPostindex').val(suggestion.data.postal_code); - else - { - $("#input{$item.name|capitalize}").closest('form').append( - $('').attr('id', 'inputPostindex').attr('name', 'postindex').attr('type', 'hidden').val(suggestion.data.postal_code) - ) - } + onSelect: function(suggestion) + { + $('#hiddenPostindex').val(suggestion.data.postal_code).change(); + $('#hiddenCity').val(suggestion.data.city).change(); + $('#hiddenRegion').val(suggestion.data.region).change(); } }); {/if} + + {if $item.htmltype eq 'hidden'} + + {/if} + {if $item.htmltype eq 'combostore'}
@@ -129,7 +128,7 @@
{/if} {/if} - {if $smarty.foreach.fieldscounter.iteration%(($fieldscount+$fieldscount%2)/2) == 0 && $smarty.foreach.fieldscounter.iteration!=$smarty.foreach.fieldscounter.last}
{/if} + {if $smarty.foreach.fieldscounter.iteration%(($orderfieldcount+$orderfieldcount%2)/2) == 0 && $smarty.foreach.fieldscounter.iteration!=$smarty.foreach.fieldscounter.last}
{/if} {/foreach}
{else} @@ -176,11 +175,12 @@ {/if} + +
- {if $orderwelcome}{$orderwelcome}{/if} - +