欢迎来到课桌文档! | 帮助中心 课桌文档-建筑工程资料库
课桌文档
全部分类
  • 党建之窗>
  • 感悟体会>
  • 百家争鸣>
  • 教育整顿>
  • 文笔提升>
  • 热门分类>
  • 计划总结>
  • 致辞演讲>
  • 在线阅读>
  • ImageVerifierCode 换一换
    首页 课桌文档 > 资源分类 > DOC文档下载  

    Ecshop多货币解方案设计地开发.doc

    • 资源ID:21178       资源大小:460KB        全文页数:9页
    • 资源格式: DOC        下载积分:10金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Ecshop多货币解方案设计地开发.doc

    wordEcshop多货币1:在themes下找到自己模板目录,进入library/page_header.lbi在自己喜欢的地方添加:<a href="$url_head&currency=USD">美元</a> &nbsp;<a href="$url_head&currency=GBP">英镑</a> &nbsp;<a href="$url_head&currency=EUR">欧元</a> &nbsp;<a href="$url_head&currency=Y">人民币</a> &nbsp;<a href="$url_head&currency=AUD">澳元</a>自己修改,把RMB改成卢布,然后加上瑞士法郎SEK,加元CAD,代码是:<a href="index.php?currency=USD">USD</a> &nbsp; <a href="index.php?currency=GBP">GBP</a> &nbsp; <a href="index.php?currency=EUR">EUR</a> &nbsp; <a href="index.php?currency=RUB">RUB</a> &nbsp; <a href="index.php?currency=AUD">AUD</a> &nbsp; <a href="index.php?currency=CAD">CAD</a> &nbsp; <a href="index.php?currency=SEK">SEK</a>2:在数据库里找到ecs_shop_config表,执行以下sql语句:INSERT INTO ecs_shop_config (id ,parent_id ,code ,type ,store_range ,store_dir ,value ,sort_order )VALUES (NULL , '1', 'rate', 'text', '', '', '1,0.71,0.69,6.85,1.45', '1'), (NULL , '1', 'ybprice_format', 'text', '', '', '£%s', '1'),(NULL , '1', 'aprice_format', 'text', '', '', '%s', '1'),(NULL , '1', 'cprice_format', 'text', '', '', '¥%s', '1'),(NULL , '1', 'aoprice_format', 'text', '', '', 'AU$%s', '1');自己修改代码是:增加代码:$_LANG'cfg_name''rate' = '货币汇率'$_LANG'cfg_name''ybprice_format' = '英镑格式'$_LANG'cfg_name''aprice_format' = '欧元格式'$_LANG'cfg_name''cprice_format' = '人民币格式'$_LANG'cfg_name''aoprice_format' = '澳元格式'$_LANG'cfg_desc''rate' = '输入规如此按照和美元的汇率进展输入US,EUR,BritishPound,China,Austrilian'$_LANG'cfg_desc''ybprice_format' = '显示英镑格式,%s将被替换为相应的价格'$_LANG'cfg_desc''aprice_format' = '显示欧元格式,%s将被替换为相应的价格'$_LANG'cfg_desc''cprice_format' = '显示人民币格式,%s将被替换为相应的价格'$_LANG'cfg_desc''aoprice_format' = '显示澳元格式,%s将被替换为相应的价格'显示效果:增加以下代码:参考$url_this=":/".$_SERVER'_HOST'.$_SERVER'PHP_SELF'."?id=".$_GET'id'$smarty->assign("url_head",$url_this);$currency=$_GET'currency'if ($currency!="") $_SESSION'currency'=$currency;if ($_SESSION'currency'='') $_SESSION'currency'='USD'927行下增加代码: $currency=$_SESSION'currency' $rate=explode(',',$GLOBALS'_CFG''rate'); if($currency='USD') $price=$price*$rate0; if($currency='Y') $price=$price*$rate3; if($currency='EUR') $price=$price*$rate1; if($currency='GBP') $price=$price*$rate2; if($currency='AUD') $price=$price*$rate4; 982行增加代码:switch($currency) case 'USD': return sprintf($GLOBALS'_CFG''currency_format', $price); break; case 'EUR': return sprintf($GLOBALS'_CFG''aprice_format', $price); break; case 'GBP': return sprintf($GLOBALS'_CFG''ybprice_format', $price); break; case 'AUD': return sprintf($GLOBALS'_CFG''aoprice_format', $price); break; case 'Y': return sprintf($GLOBALS'_CFG''cprice_format', $price); break; /return sprintf($GLOBALS'_CFG''currency_format', $price);5:支付方面:在后台安装paypal支付方式。6:打开数据库参加两个字段:ALTER TABLE ecs_order_info ADD currency VARCHAR( 10 ) NOT NULL ,ADD new_money DECIMAL( 10, 2 ) NOT NULL找到1608行参加代码: $order'currency'=$_SESSION'currency'$order'new_money'=price_format_hs($order'order_amount');/* * 汇率转换后的金额 * * access public * param float $price 商品价格 * return string */function price_format_hs($price, $change_price = true) $currency=$_SESSION'currency' $rate=explode(',',$GLOBALS'_CFG''rate'); if($currency='USD') $price=$price*$rate0; if($currency='Y') $price=$price*$rate3; if($currency='EUR') $price=$price*$rate1; if($currency='GBP') $price=$price*$rate2; if($currency='AUD') $price=$price*$rate4; if ($change_price && defined('ECS_ADMIN') = false) switch ($GLOBALS'_CFG''price_format') case 0: $price = number_format($price, 2, '.', ''); break; case 1: / 保存不为 0 的尾数 $price = preg_replace('/(.*)(.)(0-9*?)0+$/', '123', number_format($price, 2, '.', ''); if (substr($price, -1) = '.') $price = substr($price, 0, -1); break; case 2: / 不四舍五入,保存1位 $price = substr(number_format($price, 2, '.', ''), 0, -1); break; case 3: / 直接取整 $price = intval($price); break; case 4: / 四舍五入,保存 1 位 $price = number_format($price, 1, '.', ''); break; case 5: / 先四舍五入,不保存小数 $price = round($price); break; else $price = number_format($price, 2, '.', ''); return $price;增加 货币,金额 两列:62行增加:$_SESSION'currency'='USD'10:修改借口94行添加:$paypal_currency=$_SESSION"currency" 将$data_amount = $order'order_amount'改为:$data_amount = $order'new_money'将$currency_code = $payment'paypal_currency'改为$currency_code = $payment'paypal_currency'9 / 9

    注意事项

    本文(Ecshop多货币解方案设计地开发.doc)为本站会员(夺命阿水)主动上传,课桌文档仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知课桌文档(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-1

    经营许可证:宁B2-20210002

    宁公网安备 64010402000986号

    课桌文档
    收起
    展开