ecshop简化虚拟购物流程删除收货人信息
发布时间:12/03 来源: 浏览:
关键词:
ecshop虚拟物品人性化购物流程简化,删除“收货人信息”,一商设计更多精彩教程将会陆续更新,感谢二次开发支持关注,本次实例如下图:
修改方法分享:
找到文件include/lib_order.php,查找check_consignee_info函数:
复制内容到剪贴板折叠PHP 代码
- /**
- * 检查收货人信息是否完整
- * @param array $consignee 收货人信息
- * @param int $flow_type 购物流程类型
- * @return bool true 完整 false 不完整
- */
- function check_consignee_info($consignee, $flow_type)
- {
- if (exist_real_goods(0, $flow_type))
- {
- /* 如果存在实体商品 */
- $res = !emptyempty($consignee['email']) &&
- !emptyempty($consignee['tel']);
- return $res;
- }
- else
- {
- /* 如果不存在实体商品 */
- return !emptyempty($consignee['email']) &&
- !emptyempty($consignee['tel']);
- }
- }
打开文件js/shopping_flow.js,查找check_consignee_info函数:
复制内容到剪贴板折叠Java 代码
- /* *
- * 检查收货地址信息表单中填写的内容
- */
- function checkConsignee(frm)
- {
- var msg = new Array();
- var err = false;
- if (frm.elements['country'] && frm.elements['country'].value == 0)
- {
- msg.push(country_not_null);
- err = true;
- }
- if (frm.elements['province'] && frm.elements['province'].value == 0 && frm.elements['province'].length > 1)
- {
- err = true;
- msg.push(province_not_null);
- }
- if (frm.elements['city'] && frm.elements['city'].value == 0 && frm.elements['city'].length > 1)
- {
- err = true;
- msg.push(city_not_null);
- }
- if (frm.elements['district'] && frm.elements['district'].length > 1)
- {
- if (frm.elements['district'].value == 0)
- {
- err = true;
- msg.push(district_not_null);
- }
- }
- if (Utils.isEmpty(frm.elements['consignee'].value))
- {
- err = true;
- msg.push(consignee_not_null);
- }
- if ( ! Utils.isEmail(frm.elements['email'].value))
- {
- err = true;
- msg.push(invalid_email);
- }
-
if (frm.elements['address'
打赏