Results 1 to 10 of 2252

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    Quote Originally Posted by RodG View Post
    There are several possible places where this can be 'fixed'

    http://stackoverflow.com/questions/9...rds-in-php-5-4

    Cheers
    Rod
    Great resource that stackoverflow site.
    Did some more looking and found that to stop empty value errors you add = new stdClass(); . So I added $order = new stdClass(); above the troublesome line. It seems to have worked. Ran the shipping estimator again and there were no errors in the cache.

    Do you think it is a safe option??

    Robyn

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

    Default Re: ozpost shipping module

    Quote Originally Posted by robbie269 View Post
    Great resource that stackoverflow site.
    Yeah, without even trying I find I seem to end up there when seeking the solution to many problems.

    Quote Originally Posted by robbie269 View Post
    Did some more looking and found that to stop empty value errors you add = new stdClass(); . So I added $order = new stdClass(); above the troublesome line. It seems to have worked. Ran the shipping estimator again and there were no errors in the cache.
    Well done. This is a far better solution than simply trying to suppress the warnings.

    Quote Originally Posted by robbie269 View Post
    Do you think it is a safe option??
    Personally I can't see it as being unsafe in any way, but I will add that this may not be the best place to initialize the $order variable (which is what you are doing). I'm making this statement because after having a quick look at the code/file I noted that the $order variable is being initialized on line#85 (albeit in a slightly different manner), and that if your fix is the 'correct' one, then the same fix should probably be applied to the other similar code within those elseif blocks.
    IOW, you may have only achieved a partial fix for one possible condition.

    The most important thing here though is that you have proven a point or two.

    The 1st thing you've proven is that the fix works.
    The second thing you have proven is that it isn't an ozpost problem, so I probably have no need to scour the ozpost code for a variable that I've failed to initialize.

    So having found this, if Dr Byte, Ajeh, or one of the other dev team members could please take note. This same problem has been reported by another person in another thread in relation to the USP shipping module. In neither case is the problem in the shipping modules themselves, but as Robbie has found, it is being caused by an unitialised $order variable in the shipping_estimator.php file, which as you know is one of the core zencart files.

    I'm expecting that there will be more and more of these error reports as the various hosts upgrade their PHP to V5.4.x so hopefully one of you guys can take a closer look into this to see if robbies solution is indeed 'safe', and whether or not there is an easier/better solution.

    Cheers
    Rod.

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

    Default Re: ozpost shipping module

    Quote Originally Posted by robbie269 View Post
    Do you think it is a safe option??
    It still looks 'safe', but my earlier suspicions have just been confirmed, this is probably not the optimum location for the fix. You'll probably need to apply the same fix just before line#92

    http://www.zen-cart.com/showthread.p...33#post1222033

    Cheers
    Rod

  4. #4
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    Quote Originally Posted by RodG View Post
    It still looks 'safe', but my earlier suspicions have just been confirmed, this is probably not the optimum location for the fix. You'll probably need to apply the same fix just before line#92

    http://www.zen-cart.com/showthread.p...33#post1222033

    Cheers
    Rod
    Hi Rod

    Funnily enough I did put it above line 92 as I was getting 2 errors, one at line 117 and one at line 92.
    This is the code I added (red being the new code):
    Code:
    $order = new stdClass();
    	$order->delivery = array('postcode' => $zip_code,
    I may have to add the code above line 117 as well.

    Robyn
    Last edited by robbie269; 11 Oct 2013 at 10:33 PM.

  5. #5
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    Quote Originally Posted by robbie269 View Post

    I may have to add the code above line 117 as well.
    I got errors overnight for line 117 and 107 but not line 92. So I have partially fixed it.
    I have now added the code above lines 92, 107 & 117. The lines with $order->delivery. Hopefully that gets rid of all the errors.

    Robyn

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

    Default Re: ozpost shipping module

    Quote Originally Posted by robbie269 View Post
    I got errors overnight for line 117 and 107 but not line 92. So I have partially fixed it.
    I have now added the code above lines 92, 107 & 117. The lines with $order->delivery. Hopefully that gets rid of all the errors.

    I haven't tried, but I'm wondering if adding

    $order = new stdClass();

    To line#46 or thereabouts would take the place of all of the other additions (as well as any others not yet identified)

    Cheers
    Rod


  7. #7
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    Quote Originally Posted by RodG View Post
    I haven't tried, but I'm wondering if adding

    $order = new stdClass();

    To line#46 or thereabouts would take the place of all of the other additions (as well as any others not yet identified)

    Cheers
    Rod

    OK I have put it at line 46 only. Got no errors when I used the shipping estimator to test but I will see how it goes overnight.

    Robyn

  8. #8
    Join Date
    Feb 2010
    Location
    New South Wales, Australia
    Posts
    228
    Plugin Contributions
    0

    Default Re: ozpost shipping module

    No errors so far with code here:
    Code:
     require_once('includes/classes/http_client.php'); // shipping in basket
    //PHP5.4 fix
    $order = new stdClass();
    /*
    // moved below and altered to include Tare
      // totals info
      $totalsDisplay = '';
    Rod, I'll let you know if anything changes.

    Robyn

 

 

Similar Threads

  1. v151 Product dimensions revert to 0 - using ozpost module
    By mpforum in forum General Questions
    Replies: 8
    Last Post: 18 Apr 2014, 09:49 AM
  2. Ozpost and module help
    By janelle in forum Addon Shipping Modules
    Replies: 2
    Last Post: 15 Jun 2012, 09:19 AM
  3. Ozpost Combine shipping !! Possible ?
    By toytemple in forum Addon Shipping Modules
    Replies: 7
    Last Post: 21 Jan 2010, 02:22 PM
  4. ozpost module problems
    By hspark in forum Addon Shipping Modules
    Replies: 19
    Last Post: 7 Dec 2009, 12:44 PM
  5. store pick-ip in ozpost shipping module
    By lazerweb in forum Addon Shipping Modules
    Replies: 2
    Last Post: 29 Jul 2008, 05:04 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