Author Topic: Unable to Add Product  (Read 3740 times)

Offline srs

  • Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
    • View Profile
Unable to Add Product
« 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 !
« Last Edit: May 17, 2013, 10:26:59 AM by srs »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4153
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Unable to Add Product
« Reply #1 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;
  }

« Last Edit: May 17, 2013, 11:56:27 AM by abantecart »
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline srs

  • Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
    • View Profile
Re: Unable to Add Product
« Reply #2 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?

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4153
  • Karma: +251/-9
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Unable to Add Product
« Reply #3 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.
We need your help to build better free open source eCommerce platform for everyone.
See how you can help

Offline srs

  • Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
    • View Profile
Re: Unable to Add Product
« Reply #4 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.

 

Powered by SMFPacks Social Login Mod