Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26
  1. #11
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Hi DrByte,

    I'm seeing this problem on my store too. It seems to kick in when the delivery address is in another tax zone. In my case zero rating a sale for export to the US. You then end up with this on the payment page "UK VAT (20%) + VAT Zero Rated for Export:". Vat is charged on the items and any store collection charge is zero rated.

    I've tried on PHP 7.1 to 7.4 and it is the same. Previously I was on ZC 1.5.6 and the issue appeared when I upgraded to 1.5.7b.

    Brent

  2. #12
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Quote Originally Posted by DrByte View Post
    I'm not getting any logs in this situation. Just a quiet reload of Step 1
    In attempts to identify how/when $_SESSION['shipping'] could "rightfully" be set to false, I think I found a condition at least as it relates to Carbonless' situation.

    I find that in the page load of checkout_shipping, at about line 209 of includes/modules/pages/checkout_shipping/header_php.php the value of $_SESSION['shipping'] gets set to false even though as described above it is not expected to be such overall...

    I did recreate this issue when I made store pickup to be the only shipping module that was enabled, I added a second "location" that did not have a price associated with it along with a zero price for the overall.

    When I did as Carbonless suggested of loading the checkout_shipping page where no default is selected (basically because "cheapest" ignores the store pickup module even if it is the only module at play) and therefore returns false that upon page load/reload is still false and therefore fails in the orders class. Seems that perhaps a check should be performed before that point to "clear" out the shipping session in that situation? Otherwise, in the cheapest method to do some level of "accounting" where, if the only active module is the store pickup that when evaluating the cheapest option that it select perhaps the method that is not a 0 charge though perhaps that too if all charges are a 0 charge...

    Not yet sure on Bruce's issue yet. Have to figure out what the condition(s) are.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #13
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    608
    Plugin Contributions
    0

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    I think the error does kick in when there are no available shipping options.

    Last night I removed the store pickup plugin and added store pickup as a method in Conor's Advanced Shipping which I use. With only Advance Shipper active as soon as I had any products in in my basket that didn't have a shipping method assigned I got the error.

  4. #14
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,684
    Plugin Contributions
    123

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Yep, seeing more of these in my monthly checks now.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #15
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,145
    Plugin Contributions
    11

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Yep
    Code:
    [09-Apr-2021 13:02:47 US/Central] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: {"id":"","title":"United States Postal Service (Priority Mail™ (2 - 3 days))","cost":19.71000000000000085265128291212022304534912109375} in /includes/classes/order.php on line 323

  6. #16
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,237
    Plugin Contributions
    20

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    We're seeing this too on ZC157c

    Has anyone got a definitive solution yet?
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  7. #17
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Quote Originally Posted by Ryk View Post
    We're seeing this too on ZC157c

    Has anyone got a definitive solution yet?
    "Solution" may depend on the conditions of the site. In another post, I identified the following conditions that could cause $_SESSION['shipping'] = false (and then the error log to be generated):

    If the "cheapest" method in the shipping class has the potential to return false even if all else is "correctly" setup. That is a point where $_SESSION['shipping'] can be set to false without 'false' being hardcoded to "suit" said search...

    Ways this could "physically" happen:
    $this->modules is not an array (note though there are other checks and operations in normal processing at least in includes/modules/pages/checkout_shipping/header_php.php to not attempt to get the result of the cheapest function unless "basically" this condition has already been met.

    So, next chance?
    Basically there are no $rates calculated, this involves using the default value of $cheapest which is false at that point and the internal loop never gets processed to change the value of $cheapest to one of the rates.
    Last chance within this method: an observer of NOTIFY_SHIPPING_MODULE_CALCULATE_CHEAPEST has set $cheapest to false.

    So what does it take in a default install to get to the cheapest method calculation?

    $_SESSION['shipping'] isn't set, $_SESSION['shipping']['id'] is not set, or $_SESSION['shipping']['id'] is falsey. Then if any of those are true, if there is at least one shipping module...

    How is it that specifically no rates get set? A few different ways: $quotes['methods'] is empty (not set, an array of zero elements, a pair of quotes, the value 0, false, etc...). If there are methods with quotes but the cost is not set as in: $quotes['methods'][$i]['cost'] is not set.


    Then... Doing a search for points where $_SESSION['shipping'] is set, assuming that consistent code formatting is used to then search on '$_SESSION['shipping'] = ', there are very few cases at all where it is set to anything let alone a non-array. Basically as already stated in a default install there are two places where this could occur: paying with paypal or standard checkout when stepping through the header file.

    That said, there is also the assignment of $shipping_modules->cheapest to $shipping in includes/modules/shipping_estimator.php though I don't know yet what impact that would have if it is set to false at that point. And that was just found by searching on 'cheapest('. I didn't try with a space before the parentheses. Nor have I sought for any weird situations like use of a variable assigned to 'cheapest' and using it as a function...

    Additionally, there is a condition possible while processing a paypal payment where the same could occur as discussed in this post, namely:
    Alternatively and to wrap back around to the original question/information (started before prompted in a previous message), it looks like it could be possible that a purchase could be made with $_SESSION['shipping'] not being set if during ec_step2 the cart is determined/identified as possibly being changed, because the order is not present (does not appear to be in the path of being set until after this "change in contents") the section of code mentioned is "processed" and then with the store *not* setup to select the cheapest shipping method, then a purchase appears to be able to complete through paypal without $_SESSION['shipping'] being set. Additionally, because $_SESSION['shipping'] was unset when the cart "discrepancy" was identified, this path of processing would result in reaching the code snippet in the OP but bypassing it because $_SESSION['shipping'] is not set. So the last conditions that cause(d) unsetting are from includes/modules/paypalwpp.php at/around Line 1875:
    Code:
    (isset($response['SHIPPINGCALCULATIONMODE']) && $response['SHIPPINGCALCULATIONMODE'] != 'Callback') && (!(isset($_SESSION['paypal_ec_markflow']) && $_SESSION['paypal_ec_markflow'] == 1))
    There doesn't appear to be anything at this point that ensures correction to the shipping session value in this situation.

    Regardless, more information about store setup and ways to reach the orders class code section where the log is generated would help to identify potential corrections. (e.g. how the store is modified from original as suggested in the posting tips).
    Last edited by mc12345678; 28 Apr 2021 at 11:54 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #18
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Quote Originally Posted by Brent View Post
    I think the error does kick in when there are no available shipping options.

    Last night I removed the store pickup plugin and added store pickup as a method in Conor's Advanced Shipping which I use. With only Advance Shipper active as soon as I had any products in in my basket that didn't have a shipping method assigned I got the error.

    Confirmed this is happening on a stock 1.57c install when the shipping options are not available or return as unavailable in my region.

    Debug Log:
    [18-May-2021 02:23:21 America/Chicago] PHP Notice: Malformed value for session-based shipping module; customer will need to re-select: false in includes/classes/order.php on line 327
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  9. #19
    Join Date
    Apr 2019
    Posts
    244
    Plugin Contributions
    0

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    This issue also happens on 1.57d, when the shipping options are not available (like to Russia).

    The strange thing is, if I want to get a shipping quote in shopping cart page, there is no log or error generated. If I want to get a shipping quote during checkout process, this log file will be generated.

  10. #20
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: DeBug-Log file created on every order for Malformed value for session-based shipp

    Quote Originally Posted by njcyx View Post
    This issue also happens on 1.57d, when the shipping options are not available (like to Russia).

    The strange thing is, if I want to get a shipping quote in shopping cart page, there is no log or error generated. If I want to get a shipping quote during checkout process, this log file will be generated.
    What shipping modules are enabled?

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v155 Log files being created every couple of minutes
    By Congerman in forum General Questions
    Replies: 12
    Last Post: 17 Feb 2019, 05:22 PM
  2. v151 How to debug when NO ERROR LOG file created?
    By Jeff_Mash in forum General Questions
    Replies: 8
    Last Post: 24 Jan 2014, 10:50 PM
  3. Shipping Costs based on Total Value for individual cartons
    By sivivatu in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Jun 2009, 05:37 PM
  4. Where is the log file when you set Debug Mode to "Log File"?
    By alicia1234 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 1 Feb 2009, 12:05 AM
  5. Create a text file for every order
    By ryudice in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 May 2008, 05:46 PM

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