Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2018
    Posts
    118
    Plugin Contributions
    0

    Default I want to understand the specific role of the two judgments below.

    Both judgment statements seem to be back to the login page, I want to understand what they actually do, under what circumstances will work.

    Name:  QQ截图20190906095151.jpg
Views: 58
Size:  27.8 KB

  2. #2
    Join Date
    Jul 2012
    Posts
    14,794
    Plugin Contributions
    17

    Default Re: I want to understand the specific role of the two judgments below.

    Quote Originally Posted by jiji2018 View Post
    Both judgment statements seem to be back to the login page, I want to understand what they actually do, under what circumstances will work.

    Name:  QQ截图20190906095151.jpg
Views: 58
Size:  27.8 KB
    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...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    Apr 2018
    Posts
    118
    Plugin Contributions
    0

    Default Re: I want to understand the specific role of the two judgments below.

    Quote Originally Posted by mc12345678 View Post
    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.
    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?

  4. #4
    Join Date
    Jul 2012
    Posts
    14,794
    Plugin Contributions
    17

    Default Re: I want to understand the specific role of the two judgments below.

    Quote Originally Posted by jiji2018 View Post
    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...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  5. #5
    Join Date
    Jan 2004
    Posts
    65,318
    Blog Entries
    7
    Plugin Contributions
    228

    Default Re: I want to understand the specific role of the two judgments below.

    Quote Originally Posted by jiji2018 View Post
    Both judgment statements seem to be back to the login page, I want to understand what they actually do, under what circumstances will work.

    Name:  QQ截图20190906095151.jpg
Views: 58
Size:  27.8 KB
    @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.

 

 

Similar Threads

  1. I don't want the images from a specific category to show on the homepage... HELP!!!
    By MandyMac in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Mar 2012, 02:51 AM
  2. I have two colons below my ez pages where can I find them in the html?
    By curbsidestudiosNET in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Jun 2010, 06:47 PM
  3. I want to hide the (category) title just below my nav tabs.
    By jessicasin in forum Templates, Stylesheets, Page Layout
    Replies: 15
    Last Post: 21 Dec 2009, 03:06 AM
  4. I want the Product Title to be below the image...
    By ssolis5788 in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 10 Mar 2007, 11:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR