Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify the order purchase of dedecms5.7 Mall system

Shulou Source: shulou.com Published: 2022-06-02 03:31:50 10月03日 Update

This article mainly introduces the dedecms5.7 Mall system order purchase how to modify, the article is very detailed, has a certain reference value, interested friends must read it!

Dedecms5.7 Mall system order purchase how to modify?

Method 1.

To modify the order procedure of DEDE itself, doesn't DEDE just require registered members? Simple, then I now register a public member to write dead in the program, that is, in the user name and password field, I automatically write the value on OK, hehe, of course, if you want to be smart, if the user is a member, use the user's member number, otherwise use the default account is also simple ah JS!

Method 2.

You can do this and try to turn on the member function in the background first. if you don't want to have a member to join, you can prohibit the member from registering.

Then find the plus/carbuyaction.php file

Delete the following code

The code is as follows:

/ / confirm the user login information if ($cfg_ml- > IsLogin ()) {$userid = $cfg_ml- > masked ID;} else {$username = trim ($username); $password = trim ($password); if (empty ($username) | | $password) {ShowMsg ("Please login!" , "- 1", 0 2000); exit ();} $rs= $cfg_ml- > CheckUser ($username,$password); if ($rs==0) {ShowMsg ("user name does not exist!" , "- 1", 0P.2000); exit ();} else if ($rs==-1) {ShowMsg ("wrong password!" , "- 1", 0jue 2000); exit ();} $userid = $cfg_ml- > masked ID;}

In my site, these two can not completely solve the problem, but a combination of two people, just meet my requirements. There is a problem in the first person's thinking, that is, "if someone buys something and does not pay, later users will not have to pay together to see other unpaid orders." some people have raised this question, which is not ideal. After the second person deleted the code, the login information of the user was not associated with the order, so we asked tourists to order and members to buy. As follows, I made the following changes:

/ plus/carbuyaction.php

The code is as follows:

/ / confirm the user login information if ($cfg_ml- > IsLogin ()) {$userid = $cfg_ml- > masked ID;} else {$username = trim ($username); $password = trim ($password); if (empty ($username) | | $password) {ShowMsg ("Please login!" , "- 1", 0 2000); exit ();} $rs= $cfg_ml- > CheckUser ($username,$password); if ($rs==0) {ShowMsg ("user name does not exist!" , "- 1", 0P.2000); exit ();} else if ($rs==-1) {ShowMsg ("wrong password!" , "- 1", 0jue 2000); exit ();} $userid = $cfg_ml- > masked ID;}

Change to

The code is as follows:

/ / confirm user login information if ($cfg_ml- > IsLogin ()) {$userid = $cfg_ml- > masked 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 ("user name does not exist!" , "- 1", 0P.2000); exit ();} else if ($rs==-1) {ShowMsg ("wrong password!" , "- 1", 0jue 2000); exit ();} $userid = $cfg_ml- > masked ID;}}

The modification means that if the user is not logged in, then I will assign 0 to id, so that as long as I see the order placed at 0 in the background, it is the tourist's. After the current test, no problem was found.

The above is all the contents of how to modify the purchase order of dedecms5.7 Mall system, thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: User order member login namely code information password user name mall system error problem payment two content method background visitor program Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia MySQL Docker Linux