AbanteCart Community

eCommerce construction => Installation and Configuration => Fresh Installation => Topic started by: srs on May 17, 2013, 08:36:43 AM

Title: Unable to Add Product
Post by: srs on May 17, 2013, 08:36:43 AM
I get this when trying to add a new product.

Fatal error: Call to undefined function strptime() in C:\Inetpub\vhosts\wycherail.co.uk\httpdocs\ShopAbante\core\helper\utils.php on line 340

The software does not reside in my C:drive and does not need to, so why is it looking there for information that is on the web site?

And now I can't even get into the Admin function - it just brings up the store front !
Title: Re: Unable to Add Product
Post by: abantecart on May 17, 2013, 11:54:38 AM
This issue related to Windows platform. This function is not implemented on Windows platforms.

At the end of the file ...\core\helper\utils.php add below code:

Code: [Select]

function strptime($date, $format) {
    $masks = array(
      '%d' => '(?P<d>[0-9]{2})',
      '%m' => '(?P<m>[0-9]{2})',
      '%Y' => '(?P<Y>[0-9]{4})',
      '%H' => '(?P<H>[0-9]{2})',
      '%M' => '(?P<M>[0-9]{2})',
      '%S' => '(?P<S>[0-9]{2})',
     // usw..
    );

    $rexep = "#".strtr(preg_quote($format), $masks)."#";
    if(!preg_match($rexep, $date, $out))
      return false;

    $ret = array(
      "tm_sec"  => (int) $out['S'],
      "tm_min"  => (int) $out['M'],
      "tm_hour" => (int) $out['H'],
      "tm_mday" => (int) $out['d'],
      "tm_mon"  => $out['m']?$out['m']-1:0,
      "tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0,
    );
    return $ret;
  }

Title: Re: Unable to Add Product
Post by: srs on May 17, 2013, 01:05:38 PM
Thank you for that. Code added and add products now accessible.

Noticed that start of utils.php carries a warning:
UPGRADE NOTE:
   Do not edit or add to this file if you wish to upgrade AbanteCart to newer
   versions in the future. If you wish to customize AbanteCart for your
   needs please refer to [your website] for more information.  (I would have quoted completely but you have set your forum up to reject links - even to yourselves !)

Does this mean that any upgrade installed in the future will lose this amendment?

Are there any other problems affecting use on a Windows server that aren't mentioned in the install instructions?
Title: Re: Unable to Add Product
Post by: abantecart on May 17, 2013, 02:42:15 PM
We will add this fix to the core and you will not loose this in upgrade.

Regarding Windows support.

Although we know that AbanteCart works on Windows platform (aside of this issue), we can not officially state we support it 100%. 
We do not have capacity to run all the tests on all different platforms. We recommend apache and linux/unix.

Feel free to help with testing problems on Windows.
Title: Re: Unable to Add Product
Post by: srs on May 17, 2013, 04:13:21 PM
On you web site you state "AbanteCart runs on most server configurations, Windows or Linux based servers that utilize different PHP configurations." The server I am using complies with the PHP specification that appears above that statement.

I am left wondering how many more problems will appear before I have a properly working version on a windows platform.

I have already found another problem - see separate subject.