分享

ECSHOP购物车流程删除电话,邮箱,手机,必填选项改成非必填

 秋天的童话980 2017-09-27

首先先来说下怎么删除电话、邮箱

 

1.注册页面电话/邮箱删除:后台会员注册项设置---电话打勾去掉  邮箱打勾去掉

 

 

2. 打开js/shopping_flow.js文件,找到checkConsignee()函数

 

1:如何设置ecshop“收货人姓名”为可选项?

打开js/shopping_flow.js文件,找到checkConsignee()函数

/*if (Utils.isEmpty(frm.elements['consignee'].value))
{
err = true;
msg.push(consignee_not_null);
}*/
注释掉这一段。

flow.php中

/*if (!check_consignee_info($consignee, $flow_type))
{

ecs_header('Location: flow.php?step=consignee\n');
exit;
}*/

这段该注释掉

2:如何设置ecshop'详细地址'为选填项

打开js/shopping_flow.js文件,找到checkConsignee()函数

注释掉下面

/*
if (frm.elements['address'] && Utils.isEmpty(frm.elements['address'].value))
{
err = true;
msg.push(address_not_null);
}*/

flow.php中

/*if (!check_consignee_info($consignee, $flow_type))
{

ecs_header('Location: flow.php?step=consignee\n');
exit;
}*/

这段该注释掉

 

如果只要电话和邮箱这里开始就可以了

 

3:如何设置ecshop'电子邮件地址'为选填项

打开js/shopping_flow.js文件,找到checkConsignee()函数

注释掉下面

if ( ! Utils.isEmail(frm.elements['email'].value))
{
err = true;
msg.push(invalid_email);
}

flow.php中

/*if (!check_consignee_info($consignee, $flow_type))
{

ecs_header('Location: flow.php?step=consignee\n');
exit;
}*/

这段该注释掉

4:如何设置ecshop'电话'为选填项

打开js/shopping_flow.js文件,找到checkConsignee()函数

注释掉下面

/*
if (Utils.isEmpty(frm.elements['tel'].value))
{
err = true;
msg.push(tele_not_null);
}
else
{
if (!Utils.isTel(frm.elements['tel'].value))
{
err = true;
msg.push(tele_invaild);
}
}
*/

flow.php中

/*if (!check_consignee_info($consignee, $flow_type))
{

ecs_header('Location: flow.php?step=consignee\n');
exit;
}*/

这段该注释掉

 

 

然后打开:library/这个文件夹 找到consignee.lbi文件

搜索:

{$lang.phone}:{$lang.require_field}

 

直接删除 这样就删除掉电话了,如果要保留 删除这个就可以{$lang.require_field}===必填 这句话

 

 

ecshop'电子邮件地址'为选填项

{$lang.email_address}: {$lang.require_field}

直接删除 这样就删除掉电子邮件地址了,如果要保留 删除这个就可以{$lang.require_field}===必填 这句话

 

用户中心还有收货人信息电话和邮箱: 打开flow.dwt

 

找到电话删除

找到邮箱删除



现在谈谈手机和固定电话请至少填写一项修改方法:

 

打开js/shopping_flow.js文件,找到checkConsignee()函数

if (Utils.isEmpty(frm.elements['tel'].value))
{
err = true;
msg.push(tele_not_null);
}
else
{
if (!Utils.isTel(frm.elements['tel'].value))
{
err = true;
msg.push(tele_invaild);
}
}
if (frm.elements['mobile'] && frm.elements['mobile'].value.length > 0 && (!Utils.isTel(frm.elements['mobile'].value)))
{
err = true;
msg.push(mobile_invaild);
}

 

改成:

 

if ((Utils.isEmpty(frm.elements['tel'].value))&&(Utils.isEmpty(frm.elements['mobile'].value)))
{
err = true;
msg.push(tele_not_null);
}
else
{
if (frm.elements['tel'] && frm.elements['tel'].value.length > 0 && !Utils.isTel(frm.elements['tel'].value))
{
err = true;
msg.push(tele_invaild);
}
if (frm.elements['mobile'] && frm.elements['mobile'].value.length > 0 && (!Utils.isMobile(frm.elements['mobile'].value)))
{
err = true;
msg.push(mobile_invaild);
}
}


然后打开languages/zh_cn/shiping_flow.php  中,查找 $_LANG['flow_js']['tele_not_null'] ,大概109行,将此行修改为 $_LANG['flow_js']['tele_not_null'] = '手机和固定电话请至少填写一项!';

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约