修改程式方法:
- 分別編輯以下檔案:
- [catalog/view/theme/default/template/account/address_form.tpl]
- [catalog/view/theme/default/template/account/register.tpl]
- [catalog/view/theme/default/template/affiliate/edit.tpl]
- [catalog/view/theme/default/template/affiliate/register.tpl]
- [catalog/view/theme/default/template/checkout/address.tpl]
- [catalog/view/theme/default/template/checkout/guest.tpl]
- [catalog/view/theme/default/template/checkout/guest_shipping.tpl]
- [catalog/view/theme/default/template/checkout/register.tpl ]
- [catalog/view/theme/default/template/total/shipping.tpl]
- 搜索以下程式碼:
<?php foreach ($countries as $country) { ?> <?php if ($country['country_id'] == $country_id) { ?> <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option> <?php } else { ?> <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option> <?php } ?> <?php } ?>
- 將以上程式碼替換為以下程式碼:
<?php foreach ($countries as $country) { ?> <option value="<?php echo $country['country_id']; ?>" <?php if ($country['country_id'] == $country_id) { ?>selected="selected"<?php } ?> style="background: url('image/flags/<?php echo strtolower($country['iso_code_2']); ?>.png') center right no-repeat;"><?php echo $country['name']; ?></option> <?php } ?>
以上方法適用於Opencart v1.5.1.3
每個國家旁邊都有一支小國旗,十分酷啊!
但這效果只有Firefox能夠展示,真是可惜!
但這效果只有Firefox能夠展示,真是可惜!
因為目前Google Chrome和Internet Explorer都不支援<option>
有背景圖片。
今次真係冇叉用!
0 comments:
Post a Comment