Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default PP Express and Austpost Error

    Hi all,

    I hope you can help me! Paypal Express was working fine up till now. I have installed the AustPost module and the regular checkout process seems to work fine.

    However when i click on PayPal Express, it takes me to Paypal with no problems but when it comes back to my site for shipping confirmation i get the following:


    Warning: Division by zero in /var/virtual/web/w0713/html/store/includes/modules/shipping/austpost.php on line 166

    Warning: Cannot modify header information - headers already sent by (output started at /var/virtual/web/w0713/html/store/includes/modules/shipping/austpost.php:166) in /var/virtual/web/w0713/html/store/includes/functions/functions_general.php on line 44

    Can anyone please help?
    Cheers,
    Neil

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

    Default Re: PP Express and Austpost Error

    G'day Neil,

    Your problem is a real puzzler. The reason being is that the Austpost module has no code associated with it that would cause it to act differently on the basis of method of payment.
    Furthermore, to the best of my knowledge, the PPexpress should NOT be coming back to your store to 'confirm shipping price', and even if it did do this, the portion of code producing the error shouldn't be executed because this is part of the code that 'builds' ALL of the shipping quotes, not just the quote that had been previously selected prior to clicking the PP express link.

    In other words, as the author of the austPost module, I'm totally at a loss to explain the ultimate cause of the problem.

    What I *can* tell you (in addition to the above) is even though this code *shouldn't* be executed after the payment link has been clicked, the actual error (Division by zero) is being caused because the product(s) in the cart at the time of the error are missing one or more of their dimensions.. This is *probably* because the code is called with no valid data, which is kinda what I'd expect to occur if it is being executed when it shouldn't be.

    About the only useful thing I can suggest at this stage is for you to double check what page the PP express module is returning you too, because it really shouldn't be returning to the austpost shipping module.

    Cheers
    Rod

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: PP Express and Austpost Error

    Just to clarify ...

    The PayPal Express Checkout module *does* return to the store and proceed through the normal checkout stages. But, it does so just as if the customer had clicked on the checkout_shipping page link to commence checkout. It uses the customer's address coming back from PayPal, and builds shipping quotes based on the products in the cart, just as it would for any normal checkout process.

    The customer may never see this happen if the administrator has the PP module set to auto-select the cheapest shipping method ... but it still has to go through the normal quoting process in order to determine said method.
    .

    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.

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

    Default Re: PP Express and Austpost Error

    Quote Originally Posted by DrByte View Post
    Just to clarify ...

    The PayPal Express Checkout module *does* return to the store and proceed through the normal checkout stages. But, it does so just as if the customer had clicked on the checkout_shipping page link to commence checkout. It uses the customer's address coming back from PayPal, and builds shipping quotes based on the products in the cart, just as it would for any normal checkout process.

    The customer may never see this happen if the administrator has the PP module set to auto-select the cheapest shipping method ... but it still has to go through the normal quoting process in order to determine said method.
    DrB, thanks for the clarification. Alas, I'm not sure if it helps solve Neils' problem of not (I'm still no closer to an explanation). Do YOU have any ideas on what would cause the shipping module to fail, but only with PP Express?

    Neil, If you load /includes/modules/shipping/austpost.php into a text editor and locate line#96 you should see a line that reads "debug = 0", if you change this to 'debug = 1' the austpost module will spew out a lot of useful debugging information when it is called. This may or may not give you a clue as to what is going wrong.

    Cheers
    Rod

  5. #5
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default Re: PP Express and Austpost Error

    Rod/Dr Byte,

    Thank you for your help so far. So I changed the debug as you suggested and now I get this:

    via CartC 0 - W 0 - H 2 - L 0 - I
    Warning: Division by zero in /var/virtual/web/w0713/html/store/includes/modules/shipping/austpost.php on line 166
    Warning: Cannot modify header information - headers already sent by (output started at /var/virtual/web/w0713/html/store/includes/modules/shipping/austpost.php:98) in /var/virtual/web/w0713/html/store/includes/functions/functions_general.php on line 44

    I have the dimensions on the product set to L=25 W=25 H=2 and 100 gms

    Any other ideas?

    Cheers,
    Neil
    Last edited by neilg; 23 Sep 2007 at 10:59 AM.

  6. #6
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default Re: PP Express and Austpost Error

    hold that thought guys....i think I may have figured it out....will keep you posted so you know what the solution is!

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

    Default Re: PP Express and Austpost Error

    G'day Neil,

    > now I get this:
    > via Cart

    This implies the user is logged in (IOW, not a guest account). I'm not sure if this is important at this stage, but it is worth noting that due to the way zencart works, the Austpost module gets its data to calculate prices from one of two places.. either the users 'personal' shopping cart, OR, if the user isn't logged in, via data stored in the SESSION variables.
    Data stored via the session variables should be copied into the users cart when the log in. I'm not sure at what point in the PayPal Express process this actually occurs.
    In other words, the austpost module may be trying to obtain data from the users cart when it should really be getting it from the session data?

    > C 0 - W 0 - H 2 - L 0 - I

    This pretty much confirms that the AustPost module doesn't have valid data to work with. The rest of the error messages can be ignored.

    > I have the dimensions on the product set
    > to L=25 W=25 H=2 and 100 gms

    The "- W 0 - H 2 - L 0" in the debug message is telling us/me that it has a W=0, L=0, and H=2.
    IOW, only the H variable appears valid.

    The last, and only other time I've seen something similar to this was when someone was trying to use the austpost module with a zencart version earlier than 1.3.7, so I guess this is the first thing you need to check and confirm.

    Another thing that may help in the debug process is to locate line 97 in austpost.php, and alter it so that instead of reading
    if (isset($_SESSION['customer_id'])) {

    It reads
    if (isset($_SESSION['dummy'])) {

    This will cause this check to FAIL, and therefore force the data to be obtained from the session variables rather than the users cart.
    Needless to say, you should not leave the code this way, because it will break more than it fixes. I'm not even sure if this will have the effect I'm expecting or not, it is merely a means of trying to isolate where the valid data actually exists at the point in time it is being called.
    Anyway, with this change in place, and debug still enabled, you should see among the output "via session"
    and the "C 0 - W 0 - H 2 - L 0 - I " line should have no zeros.
    If this IS the case, then we are one step closer to the solution, however, if you get 'via session' and no change on the zeros I/we are barking up the wrong tree.

    Lemme know your results.
    Cheers
    Rod

  8. #8
    Join Date
    Dec 2006
    Posts
    79
    Plugin Contributions
    0

    Default Re: PP Express and Austpost Error

    ok Rod....i got there in the end and it was a simple fix!

    in the payment options for ppexpress I had this selected to yes instead of No.

    Express Checkout: Select Cheapest Shipping Automatically
    No

    It all seems to be good now.

    I appreciate your help guys...again I couldnt have done it on my own without some of the ideas and suggestions you came up with.

    Many thanks,
    Neil

 

 

Similar Threads

  1. PayPal Express error 10471 and 10472
    By volcanocruiser in forum PayPal Express Checkout support
    Replies: 9
    Last Post: 4 Feb 2010, 07:21 AM
  2. Austpost Express Courier International feature
    By p1drobert in forum Addon Shipping Modules
    Replies: 0
    Last Post: 30 Jan 2009, 01:47 AM
  3. Austpost error
    By sampler in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 26 Feb 2008, 12:15 PM
  4. Austpost Error when trying to estimate shipping cost
    By 00snoopy in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 9 Aug 2006, 05:55 AM

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