Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 34
  1. #21
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: How can I "do something" after a successful PPE order?

    Also of interest might be lat9's Notifier Trace plugin: https://www.zen-cart.com/downloads.php?do=file&id=1114
    .

    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.

  2. #22
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How can I "do something" after a successful PPE order?

    That last bit of advice almost was perfect! I actually ran into an issue with my project. Obviously the notifier I'm using (NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES) isn't appropriate afterall because it happens BEFORE PayPal updates the database. This is important because I want to change the status to something after PayPal changes it to "processing". if I do it before, then it gets clobbered.

    I initially figured since they were getting recorded in the same second that perhaps it was just random chance which one appeared first, but I threw a 2 second sleep() in there to force my function to delay... and the PayPal still came after and still shows as the same second.

    I installed lat9's Notifier Trace plugin as you suggested, so I could see the order. But NOTIFY_CHECKOUT_PROCESS_HANDLE_AFFILIATES doesn't show up in that log at all! How's that possible? I know it is firing because my code is being called properly.

  3. #23
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How can I "do something" after a successful PPE order?

    I now see Lat9's contribution shows just a portion of the log file in the preview, so that text I was searching for wasn't showing. It is in the log itself though. I'm still unsure where I should be tapping in to achieve what I want.

  4. #24
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How can I "do something" after a successful PPE order?

    After looking a little more carefully, I think I've settled on NOTIFY_HEADER_END_CHECKOUT_PROCESS

    It gives me all the vars I need, it happens after function after_process() is called (which is what the payment modules uses to update the history), and I think it is tight enough to not have to worry about refreshes. I tried refreshing and there was no ill effect that I could see.

    Does that sound right?

  5. #25
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,377
    Plugin Contributions
    94

    Default Re: How can I "do something" after a successful PPE order?

    The notifier you chose (NOTIFY_HEADER_END_CHECKOUT_PROCESS) will do the trick for you:
    1) It's at the absolute end of the checkout_process processing, just before the redirect to checkout_success.
    2) It's not a page that is "easy" to refresh, since it's never visible in the customer's browser.

  6. #26
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How can I "do something" after a successful PPE order?

    Thanks for that lat9.

  7. #27
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: How can I "do something" after a successful PPE order?

    Quote Originally Posted by lat9 View Post
    The notifier you chose (NOTIFY_HEADER_END_CHECKOUT_PROCESS) will do the trick for you:
    1) It's at the absolute end of the checkout_process processing, just before the redirect to checkout_shipping.
    2) It's not a page that is "easy" to refresh, since it's never visible in the customer's browser.
    A possible downside to using this notifier rather than NOTIFY_HEADER_START_CHECKOUT_PROCESS (both are in the same file) is that many of the session variables are cleared before the END_CHECKOUT is called - These variables could be useful/needed by whatever the new code is designed to do.

    BTW, nice discussion going on here. These notifiers can be *so* useful for so many different things I'm surprised that there haven't been more discussions about them. For what they can be used for they seem to be so under utilised, and I suspect that part of this is because although quite well documented there hasn't been enough talk about all the possibilities and options available.

    I think it needs a discussion like this to pique the interest of more developers that are still doing things the 'old' way of hacking into core code when it's no longer really necessary.

    Cheers
    RodG

  8. #28
    Join Date
    Jul 2012
    Posts
    16,798
    Plugin Contributions
    17

    Default Re: How can I "do something" after a successful PPE order?

    Could take from both or a combinatiion. The "earlier" one to gather the session data that is then deleted later (and not otherwise retrievable), the later one to use the previous session data if it is not already captured/transferred to something else useful. This way the information is gathered as necessary/when available and used when desired...

    In a way, the worst thing that happens regarding the retriggering action is that the data is set again to what it already was... Meanwhile the "action" waits to observe the call to the notifier that is not "easy" to refresh...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #29
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: How can I "do something" after a successful PPE order?

    Quote Originally Posted by mc12345678 View Post
    Could take from both or a combination. The "earlier" one to gather the session data that is then deleted later (and not otherwise retrievable),
    Not really possible. Anything of use saved in the session data will always be available by other means at another time via other methods (generally a DB query).

    Quote Originally Posted by mc12345678 View Post
    the later one to use the previous session data if it is not already captured/transferred to something else useful. This way the information is gathered as necessary/when available and used when desired...
    I think you are way over complicating things with this approach.

    Quote Originally Posted by mc12345678 View Post
    In a way, the worst thing that happens regarding the retriggering action is that the data is set again to what it already was... Meanwhile the "action" waits to observe the call to the notifier that is not "easy" to refresh...
    The earlier notifier has all the session data needed for most purposes. What it doesn't have would need to be obtained via other means anyway.

    The later notifier will require a DB lookup for any data needed for the additional code (assuming all the sessions have been nullified).

    The 1st notifier does run the risk of multiple triggering if/when the page is reloaded, but this will be a trivial task to mitigate (see the ec_commerce module).

    Rather than trying to 'take from both' I reckon it would be better to ask the question "Is everything I need available from the session data, or do I need to perform a DB lookup.

    If the former, then the 1st notifier and a test to page refreshes would (IMO) be the easiest to use, and the most efficient code wise.

    If the latter, then since a DB query is going to be needed anyway, then use the last notifier and not have to worry about the page being refreshed.

    I really don't see the point of 'taking from both'.

    Perhaps I'm missing some important point you are trying to make here? (No offence, but even after all this time I still have a hard time trying to 'decode' many things that you write) <g> Seriously, more often than not, you're right on the money - it is just sometimes hard to see. I think this may be one of those times.


    Cheers
    RodG
    Last edited by RodG; 13 Nov 2015 at 08:27 AM.

  10. #30
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: How can I "do something" after a successful PPE order?

    The concept of "taking from both" is sound ... as in it's allowed. But it isn't always necessary.

    One's observer class could certainly listen to multiple notifier hooks, and take action on each, including progressively building up a collection of data in a class variable which is used later in the workflow.

    But for s_mack's current application I think using more than one is probably overkill. I agree with lat9's summary:
    Quote Originally Posted by lat9 View Post
    The notifier you chose (NOTIFY_HEADER_END_CHECKOUT_PROCESS) will do the trick for you:
    1) It's at the absolute end of the checkout_process processing, just before the redirect to checkout_success.
    2) It's not a page that is "easy" to refresh, since it's never visible in the customer's browser.
    .

    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.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. v154 How can I change the text in shipping estimator from "Best Way" to something else?
    By Zappa Aviaries in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 Feb 2015, 05:10 AM
  2. v150 can't seem to unzip on download "open" or after "save"
    By cyberbaffled in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 6 Apr 2012, 03:37 AM
  3. How to remove ellipses ("...") after "All Products" and "New Products" on home page?
    By jthurman in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 May 2010, 03:30 PM
  4. blank page after "successful" install on remote server
    By alnaad in forum General Questions
    Replies: 2
    Last Post: 22 Jul 2009, 05:35 PM
  5. Anyone successful make the "Group Pricing (Per Item)" & "MSRP Display" togther?
    By explorer1979 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Dec 2008, 08:37 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