你现在的位置:首页 > opencart 正文

删除opencart的语言和货币选项

看到很多使用opencart架设的商店仅使用单一语言和货币,目标应该是针对单一国家做销售,这时候语言和货币选单似乎就显得有点多于,只需要修改header.tpl就可以删掉,以下是以1.4.9.1版做范例且模版为默认模版,其他版本请发挥想象力,大致上是相同的

  1. 开启catalog\view\theme\default\template\common\header.tpl
  2. 找到下列这段程序代码(大约第110151),并删除它即可除去货币和语言选单

<div class="div7">
<?php if ($currencies) { ?>
<form action="<?php echo str_replace('&', '&amp;', $action); ?>" method="post" enctype="multipart/form-data" id="currency_form">
<div>
<?php foreach ($currencies as $currency) { ?>
<?php if ($currency['code'] == $currency_code) { ?>
<div><a><?php echo $currency['title']; ?></a></div>
<?php } ?>
<?php } ?>
<div>
<?php foreach ($currencies as $currency) { ?>
<a onclick="$('input[name=\'currency_code\']').attr('value', '<?php echo $currency['code']; ?>'); $('#currency_form').submit();"><?php echo $currency['title']; ?></a>
<?php } ?>
</div>
</div>
<div style="display: inline;">
<input type="hidden" name="currency_code" value="" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</div>
</form>
<?php } ?>
<?php if ($languages) { ?>
<form action="<?php echo str_replace('&', '&amp;', $action); ?>" method="post" enctype="multipart/form-data" id="language_form">
<div>
<?php foreach ($languages as $language) { ?>
<?php if ($language['code'] == $language_code) { ?>
<div><a><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />&nbsp;&nbsp;<?php echo $language['name']; ?></a></div>
<?php } ?>
<?php } ?>
<div>
<?php foreach ($languages as $language) { ?>
<a onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $('#language_form').submit();"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" />&nbsp;&nbsp;<?php echo $language['name']; ?></a>
<?php } ?>
</div>
</div>
<div>
<input type="hidden" name="language_code" value="" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</div>
</form>
<?php } ?>
</div>