IsLogin()){...}"; then change the code to "$cfg_ml->CheckUser (...)" can be used."/> IsLogin()){...}"; then change the code to "$cfg_ml->CheckUser (...)" can be used.">

Home >CMS Tutorial >DEDECMS >How to modify order purchase in dedecms5.7 mall system

How to modify order purchase in dedecms5.7 mall system

藏色散人
藏色散人Original
2019-12-19 09:56:462773browse

How to modify order purchase in dedecms5.7 mall system

dedecms5.7 mall system order purchase how to modify?

dedecms5.7 mall system does not require login registration How to modify the purchase order

Recommended learning: 梦Weavercms

Method 1.

Modify DEDE’s own order Program, doesn’t DEDE require registration as a member? Simple. Now I register a public member and write it in the program. In the user name and password fields, I directly write the values ​​​​and automatically. Is it OK? Haha, of course, if you want to be smarter, if the user is a member, use the user’s membership number, otherwise It’s easy to just use the default account with JS! ! !

Method 2,

You can try this operation and try to enable the membership function in the background. If you don’t want members to join, you can prohibit member registration

Then find the plus/carbuyaction.php file

Delete the following code

The code is as follows:

//确认用户登录信息
if($cfg_ml->IsLogin())
{
$userid = $cfg_ml->M_ID;
}
else
{
$username = trim($username);
$password = trim($password);
if(empty($username) || $password)
{
ShowMsg("请选登录!","-1",0,2000);
exit();
}
$rs = $cfg_ml->CheckUser($username,$password);
if($rs==0)
{
ShowMsg("用户名不存在!","-1",0,2000);
exit();
}
else if($rs==-1)
{
ShowMsg("密码错误!","-1",0,2000);
exit();
}
$userid = $cfg_ml->M_ID;
}

In my website, neither of these two can completely solve the problem, but combining the two people's works just fits my needs Require. There is a problem in the first person's idea, which is "if someone buys something without paying, subsequent users will not have to pay together and can see other unpaid orders." Someone below raised this question, which is not ideal. After the second person deleted that code, the user's login information was no longer associated with the order, so we want visitors to be able to order and members to be able to purchase. So I made the following modifications: The

code of

/plus/carbuyaction.php is as follows:

//确认用户登录信息
if($cfg_ml->IsLogin())
{
$userid = $cfg_ml->M_ID;
}
else
{
$username = trim($username);
$password = trim($password);
if(empty($username) || $password)
{
ShowMsg("请选登录!","-1",0,2000);
exit();
}
$rs = $cfg_ml->CheckUser($username,$password);
if($rs==0)
{
ShowMsg("用户名不存在!","-1",0,2000);
exit();
}
else if($rs==-1)
{
ShowMsg("密码错误!","-1",0,2000);
exit();
}
$userid = $cfg_ml->M_ID;
}

is changed to

The code is as follows:

The meaning of the modification of
//确认用户登录信息
if($cfg_ml->IsLogin())
{
$userid = $cfg_ml->M_ID;
}
else
{
$username = trim($username);
$password = trim($password);
if(empty($username) || $password)
{
$userid = 0;
}
else
{
$rs = $cfg_ml->CheckUser($username,$password);
if($rs==0)
{
ShowMsg("用户名不存在!","-1",0,2000);
exit();
}
else if($rs==-1)
{
ShowMsg("密码错误!","-1",0,2000);
exit();
}
$userid = $cfg_ml->M_ID;
}
}

is that if the user is not logged in, then I will assign 0 to the id, so that as long as the order placed by 0 is seen in the background, it belongs to the visitor. After testing so far, no problems have been found.

The above is the detailed content of How to modify order purchase in dedecms5.7 mall system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn