Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    help question Date Format for Product Availability

    Hello All,

    Althought my date format in english.php in admin and catalog side seems to be set to US english properly, it shows in a day, month, and year format on the product when I set the availability date. For example June 15, 2010. It acutally shows; "This product will be in stock on Tuesday 15 June, 2010."

    Can anyone explain how to correct this please? Your assistance is greatly appreciated.

    Jorsara

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Date Format for Product Availability

    This is using a function to set the date display from the template file:
    /includes/templates/template_default/templates/tpl_product_info_display.php

    Line #209 : <p id="productDateAvailable" class="productGeneral centeredContent"><?php echo sprintf(TEXT_DATE_AVAILABLE, zen_date_long($products_date_available)); ?></p>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: Date Format for Product Availability

    Thank you for the reply.

    When I change the format of the following;
    if ($products_date_available > date('Y-m-d H:i:s')) { to if ($products_date_available > date('Y-d-m H:i:s')) { the message disappear. Is there a way to make it work to show the proper date format in the message as such; " This product will be available on May 12 2010 instead of " This product will be in stock on Wednesday 12 May, 2010." ?

    Thank you.

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Date Format for Product Availability

    You would edit the TEXT_DATE_AVAILABLE define in includes/languages/english/YOUR_TEMPLATE/product_info.php

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Date Format for Product Availability

    Actually, if you look at the way the date is pulled in, the date is actually:
    $products_date_available

    Then, that date is processed by a function to give the current display:
    zen_date_long($products_date_available)

    You can processes that date:
    $products_date_available

    in another manner or check the functions that work on dates ...

    Looking in the file:
    /includes/functions/functions_general.php

    and searching on:
    date

    will show you several functions built into Zen Cart ... and you can always use your own ...

    The constant:
    TEXT_DATE_AVAILABLE

    is just bringing in the "text" and placing the "date" on the end of it ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: Date Format for Product Availability

    Thank you Steve for the info.

  7. #7
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: Date Format for Product Availability

    Ajeh,

    Thank you for the information. However, I still don't know how to change the date so The American People can understand it properly. In the file /includes/functions/functions_general.php there are number of formats that needs to be edited and I honstly don't know how. I apologize for my ignorance.
    These are the information I see. Where exactly can I change them to have it correctly display, for instance April 15, 2010 and not the other way around?
    ----------------------------------------------------------------------------------
    // Output a raw date string in the selected locale date format

    // $raw_date needs to be in this format: YYYY-MM-DD HH:MM:SS

    function zen_date_long($raw_date) {

    if ( ($raw_date == '0001-01-01 00:00:00') || ($raw_date == '') ) return false;



    $year = (int)substr($raw_date, 0, 4); What do these numbers mean?

    $month = (int)substr($raw_date, 5, 2);

    $day = (int)substr($raw_date, 8, 2);

    $hour = (int)substr($raw_date, 11, 2);

    $minute = (int)substr($raw_date, 14, 2);

    $second = (int)substr($raw_date, 17, 2);


    Thank you.

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Date Format for Product Availability

    If you look in that function, you will see the define for:
    DATE_FORMAT_LONG

    If you peek at your language file you will find where that is defined ...

    Using your templates and overrides for your language file, you can adjut the definition for the define for:
    DATE_FORMAT_LONG
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: Date Format for Product Availability

    Okay, this is what I see in the function_general.php

    return strftime(DATE_FORMAT_LONG, mktime($hour,$minute,$second,$month,$day,$year));

    now, are you talking about this file? where I need to change teh format?

    /public_html/includes/languages/english/CUSTOM

    If not, where exactly is the file in the languages where I need to change the "define"?

    Thank you again.

  10. #10
    Join Date
    Oct 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: Date Format for Product Availability

    Hello Ajeh,

    disregard the last update. I finally figured it. It was in the english.php and I just reversed the %b - %B to %B %d as follow;

    define('DATE_FORMAT_LONG', '%A %B %d, %Y'); // this is used for strftime()

    It is displaying them correctly now.

    Thank you again.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Date Format for products expected
    By irishshopper in forum Basic Configuration
    Replies: 1
    Last Post: 13 May 2011, 02:01 PM
  2. EZpop date format for product_special
    By george_usa in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 24 Dec 2010, 04:29 AM
  3. Updating Customer Records vs date-format for UK
    By NickSMM in forum Bug Reports
    Replies: 0
    Last Post: 6 Nov 2007, 04:36 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