服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > ecshop教程 >

ecshop如何调用收货地址

时间:2016-01-22 10:20来源:未知 作者:最模板 点击:
ecshop当中如何调用收货地址, 静态部分:html {insert_scripts files=region.js,utils.js} script type=text/javascript region.isAdmin = false; {foreach from=$lang.flow_js item=item key=key} var {$key} = {$item}; {/foreach} {literal

ecshop当中如何调用收货地址,

静态部分:html

{insert_scripts files='region.js,utils.js'}
        <script type="text/javascript">
          region.isAdmin = false;
          {foreach from=$lang.flow_js item=item key=key}
          var {$key} = "{$item}";
          {/foreach}

          {literal}
          onload = function() {
            if (!document.all)
            {
              document.forms['theForm'].reset();
            }
          }
          {/literal}
        </script>
    <select name="country" id="selCountries_{$sn}" onchange="region.changed(this, 1, 'selProvinces_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[0]}</option>
        <!-- {foreach from=$country_list item=country} -->
        <option value="{$country.region_id}" {if $consignee.country eq $country.region_id}selected{/if}>{$country.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="province" id="selProvinces_{$sn}" onchange="region.changed(this, 2, 'selCities_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[1]}</option>
        <!-- {foreach from=$province_list.$sn item=province} -->
        <option value="{$province.region_id}" {if $consignee.province eq $province.region_id}selected{/if}>{$province.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="city" id="selCities_{$sn}" onchange="region.changed(this, 3, 'selDistricts_{$sn}')" style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[2]}</option>
        <!-- {foreach from=$city_list.$sn item=city} -->
        <option value="{$city.region_id}" {if $consignee.city eq $city.region_id}selected{/if}>{$city.region_name}</option>
        <!-- {/foreach} -->
      </select>
      <select name="district" id="selDistricts_{$sn}" {if !$district_list.$sn}style="display:none"{/if} style="border:1px solid #ccc;">
        <option value="0">{$lang.please_select}{$name_of_region[3]}</option>
        <!-- {foreach from=$district_list.$sn item=district} -->
        <option value="{$district.region_id}" {if $consignee.district eq $district.region_id}selected{/if}>{$district.region_name}</option>
        <!-- {/foreach} -->
      </select>

动态php代码

/* 取得国家列表、商店所在国家、商店所在国家的省列表 */
    $smarty->assign('country_list',       get_regions());
    $smarty->assign('shop_country',       $_CFG['shop_country']);
    $smarty->assign('shop_province_list', get_regions(1, $_CFG['shop_country']));

 

(责任编辑:最模板)
顶一下
(1)
33.3%
踩一下
(2)
66.7%
------分隔线----------------------------
栏目列表
热点内容