zencart头部货币和修改货币选择方式

zencart头部货币和修改货币选择方式

此版本在zencart1.5.5测试过
这是利用zencart自身的货币选择来进行修改的
zencart头部货币修改方法
1.在includes\modules\sideboxes\找到currencies.php复制一份到includes\modules\sideboxes\you templates\下,命名为currencies_header.php
打开currencies_header.php文件,找到
[php]
require($template->get_template_dir(‘tpl_currencies.php’,DIR_WS_TEMPLATE, $current_page_base,’sideboxes’). ‘/tpl_currencies.php’);
[/php]
替换为
[php]require($template->get_template_dir(‘tpl_currencies_header.php’,DIR_WS_TEMPLATE, $current_page_base,’sideboxes’). ‘/tpl_currencies_header.php’);[/php]
在最后一行找到
[php]require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,’common’) . ‘/’ . $column_box_default);[/php]
替换为
[php]require($template->get_template_dir(‘tpl_box_header.php’, DIR_WS_TEMPLATE, $current_page_base,’common’) . ‘/tpl_box_header.php’);[/php]
2.在includes\templates\template_default\sideboxes文件夹下找到tpl_currencies.php复制一份到includes\templates\you templates\sideboxes\下, 命名为tpl_currencies_header.php
3.你的模板下打开common/tpl_header.php文件,在需要的地方加入下面代码
[php]<?php require(DIR_WS_MODULES . ‘sideboxes/you templates/currencies_header.php’); ?>[/php]
4.进入后台,Tools->Layout Boxes Controller,如下图
20160822155206
在前台头部就能看到货币选择了
20160822160832

修改zencart货币选择方式
如图
20160822161137
在你的模板sideboxes下打开tpl_currencies_header.php
删除原来代码,加入下面代码
[php]
$content = "";
$content .= ‘<ul class="store-currency-content">’;
$content .= ‘<li class="selected">’;
$content .= ‘<a class="selected" href="javascript:void()"><img src="’ . HTTP_SERVER . DIR_WS_CATALOG . ‘includes/templates/zcyii/images/icons/’ . $_SESSION[‘currency’] . ‘.png"> ‘ . $_SESSION[‘currency’] . ‘</a>’;
$content .= ‘<ul>’;
foreach($currencies_array as $currencies){
$content .= ‘<li><a href="’ . zen_href_link($_GET[‘main_page’], zen_get_all_get_params(array(‘language’)) . ‘currency=’ . $currencies[‘id’], $request_type) . ‘"><img src="’ . HTTP_SERVER . DIR_WS_CATALOG . ‘includes/templates/zcyii/images/icons/’ . $currencies[‘id’] . ‘.png"> ‘ . $currencies[‘id’] . ‘</a></li>’;
}
$content .= ‘</ul>’;
$content .= ‘</li>’;
$content .= ‘</ul>’;
[/php]
后面的css调试就通过自己去调试了

下载地址
百度盘链接: http://pan.baidu.com/s/1jHRBmUq 密码: ds9d

发表评论

© 2022. powered by PHP 个人小站