Nop 4.1版本已经迁移到.net core2.1版本

1. github 下载,4.1版本,运行, install时,会让你新增后台账户密码,sql服务器

2. 在Configuration 新增Language

3. 上传中文语言包 , 你也可以先导出语言包,再编辑,不过导出xml的压缩过,你要格式化一下(http://web.chacuo.net/formatxml)

自带的英文语言包在这个路径(PresentationNop.WebApp_DataLocalizationdefaultResources.nopres.xml)

4. Configuration->plugin  访问这个页面要翻墙, 不然会request timeout

安装alipay 插件.其他原有的插件要重新卸载安装一次,不然 _localizationService.AddOrUpdatePluginLocaleResource 只有默认的英文.

或者自己在[dbo].[LocaleStringResource] 这里自行修改.

5. 支付宝插件安装之后,付款时有2个问题:

1. 主货币不是人民币时,比如是欧元, 我15.9欧的价格,支付时是显示15.9元人民币; 另一张订单118人民币的价格,转到支付宝里也变成15.9元; 

解决方案:网站标价为欧元,用欧元和人民币支付. 正确设置方法应该是:后台货币管理里把USD作为 primary exchange rate currency, 把欧元作为 Mark as primary store currency,同时把RMB的状态改为Publish
2. NOP支付宝插件的MD5值是大写,但支付宝接口要求的md5值是小写的.另外测试时发现有时签名错误,有时签名又是正确的. mygod, 错误时生成的md5不是32位. 是少了1位.这个要改一下代码
        internal string GetMD5(string input)
        {
            var md5 = new MD5CryptoServiceProvider();
            var t = md5.ComputeHash(Encoding.GetEncoding(InputCharset).GetBytes(input));
            var sb = new StringBuilder(32);

            foreach (var b in t)
            {
                sb.AppendFormat("{0:x2}", b);
            }

            return sb.ToString();
        }

 6. 微信支付, github只找到3.7版本的.没有4.10版本的.  需要改的地方蛮多的. 比如这个 WeChatPayPaymentProcessor 要增加这个方法

      public override string GetConfigurationPageUrl()
        {
            return $"{_webHelper.GetStoreLocation()}Admin/PaymentWeChatPay/Configure";
        }

 7. 微信支付在公众号后台需要配置,如果你商城是用二级域名, 网页授权域名就不能配一级域名

网页授权域名
shop.xxx.com

微信支付商户后台需要配置

公众号支付: 支付授权目录: 

http://shop.xxx.com/Plugins/PaymentWeChatPay/

扫码支付 扫码回调链接:

http://shop.xxx.com/Plugins/PaymentWeChatPay/

 微信支付插件代码修改

        public WxPayData UnifiedOrder(Order order, IDictionary<string, string> values)
        {
            var fullValues = new Dictionary<string, string>(values);
            var bodyText = $"支付【{_storeContext.CurrentStore.Name}】订单 #{order.Id}";
            fullValues["body"] = bodyText;
            fullValues["attach"] = _storeContext.CurrentStore.Name;
            fullValues["device_info"] = "WEB";
            fullValues["out_trade_no"] = order.Id.ToString();

            decimal CurrencyRate = order.CurrencyRate;

            if (order.CustomerCurrencyCode == "EUR")
            {
                CurrencyRate = 8; //HardCode 
            }
            fullValues["total_fee"] = Math.Round(order.OrderTotal * CurrencyRate * 100).ToString(); //微信支付以分为单位


            return this.PostApiRequest(WeixinUnifiedOrderUrl, fullValues);
        }

NOP 后台的Product Attribute 可以自定义Color,Size等属性. 反而Specification没什么用,只是页面展示一个表格.

原文地址:https://www.cnblogs.com/zitjubiz/p/nop_4_1_cn_language_pack.html