Jump to content

Can't save Order at line 345 in file classes/PaymentModule.php


wohldorff

Recommended Posts

Sometimes after customers have been directed to Paypal for payment and are being returned the shop the purchasing process is interrupted an no purchasing confirmation is generated (only the message sent py Paypal indicates that a customer tried to purchase).

 

The log files says: *ERROR* 2017/01/11 - 11:20:22: Can't save Order at line 345 in file classes/PaymentModule.php

My PS version is 1.6.1.5

 

Has anybody solved this nasty problem?

Link to comment
Share on other sites

It could be various causes. but most cases is related to shipping related or payment related error I think.

 

below the code where the error is raised. If you have enabled DEV mode, there might be more error message that can give you hints.

 

                    $result = $order->add();


                    if (!$result) {
                        PrestaShopLogger::addLog('PaymentModule::validateOrder - Order cannot be created', 3, null, 'Cart', (int)$id_cart, true);
                        throw new PrestaShopException('Can\'t save Order');

Forgot to mention, you can enable DEV mode by setting _PS_MODE_DEV_ to true in file /config/defines.inc.php

Link to comment
Share on other sites

Thanks for the analysis! Payment via Paypal works flawlessly and does not generate errors, however sometimes upon returning to the shop apparently something goes wrong - but not always.. A nasty situation that requires a manual order setup every time it happens.

I have set  _PS_MODE_DEV_ to true so let's see what happens.

Link to comment
Share on other sites

Do I have to change something here (in /config/defines.inc.php)?

 

define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);

if (_PS_MODE_DEV_ === true) {
    @ini_set('display_errors', 'on');
    @error_reporting(E_ALL | E_STRICT);
    define('_PS_DEBUG_SQL_', true);
} else {
    @ini_set('display_errors', 'off');
    define('_PS_DEBUG_SQL_', false);
}
 
define('_PS_DEBUG_PROFILING_', false);
define('_PS_MODE_DEMO_', false);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...