IsLogin()){...}"; then change the code to "$cfg_ml->CheckUser (...)" can be used."/> IsLogin()){...}"; then change the code to "$cfg_ml->CheckUser (...)" can be used.">
search
HomeCMS TutorialDEDECMSHow to modify order purchase in dedecms5.7 mall system

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor