バージョン選択

フォーラム

メニュー

オンライン状況

24 人のユーザが現在オンラインです。 (11 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 24
もっと...

サイト内検索

質問 > 管理機能 > 郵便番号データベースの登録について

管理機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
ゲスト
投稿日時: 2018/3/20 7:49
対応状況: −−−
Re: 郵便番号データベースの登録について
例えば、
src/Eccube/Resource/template/default/Entry/index.twig
なら

{% block javascript %}
<script src="//ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>
<script>
    $(function() {
        $('#zip-search').click(function() {
            AjaxZip3.zip2addr('entry[zip][zip01]', 'entry[zip][zip02]', 'entry[address][pref]', 'entry[address][addr01]');
        });
    });
</script>
{% endblock javascript %}

(snip)

<div id="top_box__zip" class="form-group form-inline input_zip {% if form.zip.zip01.vars.errors is not empty or form.zip.zip02.vars.errors is not empty %}has-error{% endif %}">{{ form_widget(form.zip) }}</div>

が、
html

<div id="top_box__zip" class="form-group form-inline input_zip ">〒<input type="text" id="zip01" name="entry[zip][zip01]" required="required" style="ime-mode: disabled;" pattern="\d*" class="form-control" />-<input type="text" id="zip02" name="entry[zip][zip02]" required="required" style="ime-mode: disabled;" pattern="\d*" class="form-control" /> <span class="question-circle"><svg class="cb cb-question"><use xlink:href="#cb-question" /></svg></span> <a href="http://www.post.japanpost.jp/zipcode/" target="_blank">郵便番号検索</a><div class="zip-search"><button type="button" id="zip-search" class="btn btn-default btn-sm">郵便番号から自動入力</button></div></div>

(snip)

<script src="//ajaxzip3.github.io/ajaxzip3.js" charset="UTF-8"></script>
<script>
    $(function() {
        $('#zip-search').click(function() {
            AjaxZip3.zip2addr('entry[zip][zip01]', 'entry[zip][zip02]', 'entry[address][pref]', 'entry[address][addr01]');
        });
    });
</script>


と、変換されて、「AjaxZip3.zip2addr()」が"//ajaxzip3.github.io/ajaxzip3.js"からリアルタイムに住所を取得します。

フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   郵便番号データベースの登録について miyaccho01 2018/3/18 19:11
     Re: 郵便番号データベースの登録について red 2018/3/19 10:41
       Re: 郵便番号データベースの登録について miyaccho01 2018/3/20 0:43
       » Re: 郵便番号データベースの登録について ゲスト 2018/3/20 7:49
           Re: 郵便番号データベースの登録について miyaccho01 2018/3/20 9:35

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,435名です
総投稿数は110,087件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1652
8
red
1570
9
mcontact
1305
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.