Both judgment statements seem to be back to the login page, I want to understand what they actually do, under what circumstances will work.
Both judgment statements seem to be back to the login page, I want to understand what they actually do, under what circumstances will work.
In code section 1, if the visitor is not logged in or if somehow they are logged in but have an id of 0 then the current page is added to the index of previous pages and the customer is taken to the login page.
In the second code section, if the functions result is true then the checkout_shipping page is added to the index of previous pages and the customer is taken to the login page.
Presumably, after completing login, the user is returned to the previous page which would likely be the page indexed above depending on the validity of the situation.
Now, knowing that you seem to be searching for how to handle customers in the checkout process, it doesn't seem like the inner workings of the function need to be described, but basically if the customer identification appears incorrect or the individual is banned then their cart session data gets removed.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
but basically if the customer identification appears incorrect or the individual is banned then their cart session data gets removed.
How to understand the above sentence, not very clear.
The second judgment in the screenshot is under what circumstances to jump to the landing page, how do I view this jump effect?
Based on the review of the code in the function zen_get_customer_validate_session, which is called if the customer_id is assigned and not zero, then if that customer_id exists in the database and the customer is not banned (customers_authorization value of 4), then the content within block 2 is executed. This somewhat means that basically the customer is already logged in at the point code block 2 is executed because the session is already set for the customer.
As far as seeing the effect, well as usual you haven't provided enough information to be able to help with that. All I can identify is that you need to have a customer_id assigned in the session that exists in the database and where the customer is not banned then execute the code presented above.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
@jiji2018, in my experience when people start posting code-interpretation questions without explaining "why", usually they're starting to get too deep into the code without clearly articulating the problem.
So, let's back up a bit: What's the business problem you're trying to solve here? What's "happening" that you don't want to have happen? What were you expecting to happen that's not happening? How is it negatively impacting your shoppers?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks