Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    PHP 8.1

    $current_method_title = shipping %a (%d %b from %H:%M) // this is from settings in my admin.


    PHP Code:
    // Add any information specified about a shipping date/time
     
    if (!is_null($method_instance['timestamp'])) {
    $current_method_title strftime($current_method_title,
     
    $method_instance['timestamp']);
    } else{ 
    something


    with the above I'm getting PHP Deprecated: Function strftime() is deprecated and I can only ether fix it to display only the text element or fix the date time element but then don't get text and date time how do I fix this please?
    Last edited by OJ_SIMON; 16 Feb 2024 at 02:38 PM.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,497
    Plugin Contributions
    88

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    If you post back the entire log (making sure to xxx-out your secret Zen Cart admin name), at least we'd be able to point you in a direction. What you've posted is not "core" Zen Cart code, but a plugin or site-specific customization.

  3. #3
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    yes it is a addon so it is not core.
    Code:
    [16-Feb-2024 14:14:30 UTC] Request URI: /index.php?main_page=shopping_cart, IP address: 82.132.212.107
    #0 /includes/modules/shipping/advshipper.php(5099): zen_debug_error_handler()
    #1 /includes/modules/shipping/advshipper.php(457): advshipper->_buildQuotes()
    #2 /includes/classes/shipping.php(201): advshipper->quote()
    #3 /includes/modules/shipping_estimator.php(151): shipping->quote()
    #4 /includes/templates/OJ/templates/tpl_shopping_cart_default.php(188): require('/home/1180590.c...')
    #5 /includes/templates/OJ/common/tpl_main_page.php(143): require('/home/1180590.c...')
    #6 /index.php(94): require('/home/1180590.c...')
    --> PHP Deprecated: Function strftime() is deprecated in /includes/modules/shipping/advshipper.php on line 5099.
    
    but really this is just about dealing with strftime() when dynamic date time are within a string of text.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,497
    Plugin Contributions
    88

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    That's coming from a commercial plugin (Advanced Shipper). I suggest you contact whomever you got that plugin from for the correction.

  5. #5
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    OK, so Zen Cart has not done what all the other PHP systems have done and created a built-in solution other then dealing with them separately.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,590
    Plugin Contributions
    30

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    Change
    PHP Code:
    $current_method_title strftime($current_method_title$method_instance['timestamp']); 
    to
    PHP Code:
    $current_method_title $zcDate->output($current_method_title$method_instance['timestamp']); 
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  7. #7
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    Thank you for this, I had tried it, but just tried it again and this just fixes/deals with the date time but not text so displays nothing where I need it to fix the date time and also allow for the text to display. which is really what strftime coped with,

    I have sort of got it working with date() but not fully:
    Code:
    // Add any information specified about a shipping date/time					if (!is_null($method_instance['timestamp'])) {
    						$current_method_title = date($current_method_title,
    							$method_instance['timestamp']);
    						
    						// Use earliest timestamp from all methods in combination as the timestamp
    						// for the overall combination
    						if (is_null($shipping_ts)) {
    							$shipping_ts = $method_instance['timestamp'];
    						} else if ($method_instance['timestamp'] < $shipping_ts) {
    							$shipping_ts = $method_instance['timestamp'];
    						}
    and I get this output:
    Shipping (CMonday002024-02-26T09:00:35+00:00k & C2024MondayMondayUTC2024-02-26T09:00:35+00:0029 +00:00Monday00000035 (£1.00) (1: 1 x £1.00 per 1))
    and without date time working:
    Shipping (Click & Collect Plus (£1.00) (1: 1 x £1.00 per 1))

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,590
    Plugin Contributions
    30

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    Oops...I see I missed my own comment on that bit "never tested" as I don't use that aspect and didn't check it when I did a global replace of this function. Sorry about that.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

  9. #9
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    Don't have to be sorry, thank you for trying, I think I will for now live with one error and have the wording I need.

  10. #10
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    79
    Plugin Contributions
    0

    Default Re: PHP Deprecated: Function strftime() is deprecated mixed text and date time ?

    I've really got to think over this weekend if this is worth days of chasseing error or to just step back again to ZC v1.5.7d already stepped back from ZC V1.5.8a. to get this site Live then ldo a local install of ZC V2 and spend time getting that ready and make the few addon's i wish for then upgrade in my timeframe.

 

 

Similar Threads

  1. Shipstation Function strftime() is deprecated in 1.58
    By gtgeorge in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 15 Feb 2024, 04:35 AM
  2. v137 Deprecated: Function ereg() is deprecated Error
    By esugrue in forum General Questions
    Replies: 6
    Last Post: 28 Mar 2012, 11:40 PM
  3. Deprecated: Function ereg() is deprecated
    By hsartcorp in forum General Questions
    Replies: 3
    Last Post: 19 Sep 2011, 08:08 PM
  4. Replies: 2
    Last Post: 3 Mar 2010, 12:53 PM
  5. Replies: 4
    Last Post: 16 Jan 2010, 02:11 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