Joomla 1.5 awo coupon version 1.5.1 time is not working


  • Default avatar
    christiana    
     11 years ago
    0

    Hi, i am trying to get the time to work for the start and expiration date and it is not working at all in version 1.5.1 only the date works. I need the time working because i am having cyber monday sales and this has to be working. Every time i try to use the time on the same date for certain hours the coupon says it is expired and does not work how do i fix this?

    thanks,

    Josh
  • Your avatar
    seyi    
     11 years ago
    0

    Hi Josh,

    AwoCoupon uses the server time as the start/expiration. So if your server is in a different timezone from your site, this would cause a problem. You could figure out the offset and try the dates accordingly, or you can try this code:

    in www/administrator/components/com_awocoupon/helpers/vm_coupon.php, around line 123 is this code
    <?php
            $current_date 
    date('Y-m-d H:i:s');
    ?>


    comment that out and add the line below
    <?php
            $current_date 
    JFactory::getDate(time(),JFactory::getConfig()->getValue 'offset' )*-1)->toFormat('%Y-%m-%d %H:%M:%S');
    ?>


    This should set the time to what you have configured in Joomla global configuration, under the server tab.
  • Default avatar
    christiana    
     11 years ago
    0

    Hi i will try what you listed above and get back to you but i checked my server time settings already and it was set exactly the same in awo coupon pro and it still did not work. They are both set to use eastern standard time( New York) and both were using military time and it wouldnt work. I have rs firewall installed do you think this is affecting it somehow?

    thanks,

    Josh
  • Default avatar
    christiana    
     11 years ago
    0

    Hi i just verified something is not working properly with the time for sure now because on the backend it says the coupon is active and it does not work on the front end. It only works when the expiration date is a different day. If both expiration dates are set to today's date for example 2012-11-19 and then start date is set to 2012-11-19 then no matter what i change the time to it does not work. Only if i change the expiration date to 2012-11-20 will it work, which means the time isn't working at all how do i fix this?

    By the way i am using version 1.1.7 of virtuemart on joomla 1.5.26 but i am not able to upgrade because there is a custom shipping module written which modified core files. Also, if i had to guess id think something has happened in recent upgrades you have done because this was working in previous versions and im still on the same server.

    This is pretty urgent to i have to have this figured out in the next day or so id be willing to send you login info if you need it to figure this out

    thanks,

    Josh
  • Default avatar
    christiana    
     11 years ago
    0

    Also, here is a link to the site
    http://www.agoodnightsleepstore.com/
  • Default avatar
    christiana    
     11 years ago
    0

    Thank you for the help! Hi, by changing the code to this below did fix it
    $current_date = JFactory::getDate(time(),JFactory::getConfig()->getValue ( 'offset' )*-1)->toFormat('%Y-%m-%d %H:%M:%S');

    However i am completely confused because here are my server settings

    Current time
    Tue Nov 20 00:00:51 EST 2012

    Time Zone
    America/New York


    The backend of my joomla site is set to
    (UTC -05:00) Eastern Time (US & Canada), Bogota, Lima

    So, both my site and server are set to eastern time so i am puzzled as to why i needed to change this code out.
  • Your avatar
    seyi    
     11 years ago
    0

    Glad you got it working.

    I believe I know the problem, its Virtuemart. Virtuemart 1 has a weird (old) way of calculating the timezones. In order to do it, it sets your timezone environment to UTC. So it does not matter what your server time is, by the time AwoCoupon is called it is UTC.