Jump to content

[SOLVED] 500 Internal error after using bank transfer


Recommended Posts

After hit my head on the wall for hours, now I can reproduce and explain the problem...

 

After a clean install of prestashop 1.5.4.0 (tested with 1.5.3.1 too) try to buy something selecting Bank transfer payment: WORKS

 

The same install, If activate and configure multishop like attached screenshot (multishop.jph), when finish the order (selecting bank transfer) I got the attached error (error.jpg)

 

If debug mode activated...

 

[PrestaShopException]
Can't load Order state status
at line 145 in file classes/PaymentModule.php139.   if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery')
140.	$context_country = $this->context->country;
141.
142.   $order_status = new OrderState((int)$id_order_state, (int)$this->context->language->id);
143.   if (!Validate::isLoadedObject($order_status))
144.	throw new PrestaShopException('Can\'t load Order state status');
145.
146.   if (!$this->active)
147.	die(Tools::displayError());
148.   // Does order already exists ?
149.   if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists() == false)
PaymentModuleCore->validateOrder - [line 64 - modules/bankwire/controllers/front/validation.php] - [9 Arguments]
58.	'{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
59.	'{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
60.	'{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
61.   );
62.
63.   $this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
64.   Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
65.  }
66. }
BankwireValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
152.	// setMedia MUST be called before postProcess
153.	if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
154.	 $this->setMedia();
155.
156.	// postProcess handles ajaxProcess
157.	$this->postProcess();
158.
159.	if (!empty($this->redirect_after))
160.	 $this->redirect();
161.
162.	if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument]
343.	// Execute hook dispatcher
344.	if (isset($params_hook_action_dispatcher))
345.	 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
346.
347.	// Running controller
348.	$controller->run();
349.   }
350.   catch (PrestaShopException $e)
351.   {
352.	$e->displayMessage();
353.   }
DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument]
22. *  @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
23. *  International Registered Trademark & Property of PrestaShop SA
24. */
25.
26. require(dirname(__FILE__).'/config/config.inc.php');
27. Dispatcher::getInstance()->dispatch();
28.

 

The same case of this post...

 

http://www.prestasho...payment-method/

 

until here...

 

http://www.prestasho...ost__p__1149011

 

because I need multishop...

 

any ideas?

 

thank's!

post-537444-0-35339000-1365768439_thumb.jpg

post-537444-0-70090100-1365768440_thumb.jpg

Edited by nandelbosc (see edit history)
Link to comment
Share on other sites

Hi again, no ideas about what we can try???

 

Using Check payment, give me the same error...

 

[PrestaShopException]
Can't load Order state status
at line 145 in file classes/PaymentModule.php
139.   if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_delivery')
140.    $context_country = $this->context->country;
141.
142.   $order_status = new OrderState((int)$id_order_state, (int)$this->context->language->id);
143.   if (!Validate::isLoadedObject($order_status))
144.    throw new PrestaShopException('Can\'t load Order state status');
145.
146.   if (!$this->active)
147.    die(Tools::displayError());
148.   // Does order already exists ?
149.   if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists() == false)
PaymentModuleCore->validateOrder - [line 64 - modules/cheque/controllers/front/validation.php] - [9 Arguments]
58.   $mailVars = array(
59.    '{cheque_name}' => Configuration::get('CHEQUE_NAME'),
60.    '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'),
61.    '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
62.
63.   $this->module->validateOrder((int)$cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
64.   Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.(int)$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
65.  }
66. }
ChequeValidationModuleFrontController->postProcess - [line 158 - classes/controller/Controller.php] - [0 Argument]
152.    // setMedia MUST be called before postProcess
153.    if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
154.	 $this->setMedia();
155.
156.    // postProcess handles ajaxProcess
157.    $this->postProcess();
158.
159.    if (!empty($this->redirect_after))
160.	 $this->redirect();
161.
162.    if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))
ControllerCore->run - [line 349 - classes/Dispatcher.php] - [0 Argument]
343.    // Execute hook dispatcher
344.    if (isset($params_hook_action_dispatcher))
345.	 Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
346.
347.    // Running controller
348.    $controller->run();
349.   }
350.   catch (PrestaShopException $e)
351.   {
352.    $e->displayMessage();
353.   }
DispatcherCore->dispatch - [line 28 - index.php] - [0 Argument]
22. *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
23. *  International Registered Trademark & Property of PrestaShop SA
24. */
25.
26. require(dirname(__FILE__).'/config/config.inc.php');
27. Dispatcher::getInstance()->dispatch();
28.

Edited by nandelbosc (see edit history)
Link to comment
Share on other sites

Solved!

 

The ps_order_state table was empty because I use these commands to delete all test orders...

 

TRUNCATE `ps_orders`;
TRUNCATE `ps_order_customization_return`;
TRUNCATE `ps_order_detail`;
TRUNCATE `ps_order_discount`;
TRUNCATE `ps_order_history`;
TRUNCATE `ps_order_message`;
TRUNCATE `ps_order_message_lang`;
TRUNCATE `ps_order_return`;
TRUNCATE `ps_order_return_detail`;
TRUNCATE `ps_order_return_state`;
TRUNCATE `ps_order_return_state_lang`;
TRUNCATE `ps_order_slip`;
TRUNCATE `ps_order_slip_detail`;
TRUNCATE `ps_order_state`;
TRUNCATE `ps_order_state_lang`;

 

As suggested here I should have read a little more

 

Solved inserting this to database...

 

 

 

INSERT INTO `ps_order_state` VALUES (1,0,1,'cheque','RoyalBlue',1,0,0,0,0,0,0),(2,1,1,'','LimeGreen',1,0,1,0,0,1,0),(3,1,1,'','DarkOrange',1,0,1,1,0,1,0),(4,1,1,'','BlueViolet',1,0,1,1,1,1,0),(5,1,0,'','#108510',1,0,1,1,1,1,0),(6,0,1,'','Crimson',1,0,0,0,0,0,0),(7,1,1,'','#ec2e15',1,0,0,0,0,0,0),(8,0,1,'','#8f0621',1,0,0,0,0,0,0),(9,1,1,'','HotPink',1,0,0,0,0,1,0),(10,0,1,'bankwire','RoyalBlue',1,0,0,0,0,0,0),(11,0,0,'','RoyalBlue',1,0,0,0,0,0,0),(12,1,1,'','LimeGreen',1,0,1,0,0,1,0);

 

Now I use this to delete orders.

Edited by nandelbosc (see edit history)
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...