500 error on cart page


  • Default avatar
    tommy4    
     11 years ago
    0

    I am immediately receiving a 500 error whenever I go to the Cart page on our site. The only error log I can find is the following:

    [27-Dec-2012 16:37:08] PHP Fatal error: Call to undefined method JDate::format() in /home/bestdamn/public_html/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php on line 50

    Any ideas?
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    What version of Joomla are you using?
  • Default avatar
    tommy4    
     11 years ago
    0

    We're running Joomla 1.5.25 and Virtuemart 2.0.12
  • Your avatar
    seyi    
     11 years ago
    0

    Ok, here is some code to fix the problem:

    in /home/bestdamn/public_html/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php
    line 50
    AND
    line 225 is this
    <?php
        $current_date 
    JFactory::getDate('now',JFactory::getConfig()->get('offset'))->format('Y-m-d H:i:s',true);
    ?>


    change them both to this
    <?php
        $current_date 
    version_compareJVERSION'1.6.0''ge' 
                            ? 
    JFactory::getDate('now',JFactory::getConfig()->get('offset'))->format('Y-m-d H:i:s',true)
                            : 
    JFactory::getDate(time(),JFactory::getConfig()->getValue 'offset' )*-1)->toFormat('%Y-%m-%d %H:%M:%S');
    ?>


    That should fix the error
  • Default avatar
    tommy4    
     11 years ago
    0

    Thanks! That fixed the 500 error! However, it's still not working. I get the following error message:

    FREESTUFF: Coupon code not found. Please try again.

    even though I have created and published the coupon and the plugin.
  • Default avatar
    tommy4    
     11 years ago
    0

    Is this a version problem because we're running Virtuemart 2.0 with Joomla 1.5? Would it be easier to upgrade Joomla?
  • Your avatar
    seyi    
     11 years ago
    0

    It should not be a version problem. Go to awocoupon->configuration->error messages and change the error messages to something identifiable, then run it again on the front end to see why its failing.