685. // Switch to back order if needed686. if (Configuration::get('PS_STOCK_MANAGEMENT') && ($order_detail->getStockState() || $order_detail->product_quantity_in_stock <= 0)) {687. $history = new OrderHistory();688. $history->id_order = (int)$order->id;689. $history->changeIdOrderState(Configuration::get($order->valid ? 'PS_OS_OUTOFSTOCK_PAID' : 'PS_OS_OUTOFSTOCK_UNPAID'), $order, true);690. $history->addWithemail();691. }692. 693. unset($order_detail);694. 695. // Order is reloaded because the status just changed
Question
Danthee
Witam,
Cały sklep działa bez zarzutu, natomiast przy potwierdzaniu zamówienia (po wybraniu sposobu płatności) wyskakuje bład.
Zrobiłem debuga i mam coś takiego:
[PrestaShopException]Property OrderHistory->id_order_state is empty
at line 909 in file classes/ObjectModel.php
904. }905. 906. $message = $this->validateField($field, $this->$field);907. if ($message !== true) {908. if ($die) {909. throw new PrestaShopException($message);910. }911. return $error_return ? $message : false;912. }913. }914.241. * @return array All object fields242. * @throws PrestaShopException243. */244. public function getFields()245. {246. $this->validateFields();247. $fields = $this->formatFields(self::FORMAT_COMMON);248. 249. // For retro compatibility250. if (Shop::isTableAssociated($this->def['table'])) {251. $fields = array_merge($fields, $this->getFieldsShop());482. 483. // Database insertion484. if (Shop::checkIdShopDefault($this->def['table'])) {485. $this->id_shop_default = (in_array(Configuration::get('PS_SHOP_DEFAULT'), $id_shop_list) == true) ? Configuration::get('PS_SHOP_DEFAULT') : min($id_shop_list);486. }487. if (!$result = Db::getInstance()->insert($this->def['table'], $this->getFields(), $null_values)) {488. return false;489. }490. 491. // Get object id in database492. $this->id = Db::getInstance()->Insert_ID();477. return true;478. }479. 480. public function add($autodate = true, $null_values = false)481. {482. if (!parent::add($autodate)) {483. return false;484. }485. 486. $order = new Order((int)$this->id_order);487. // Update id_order_state attribute in Order394. */395. public function addWithemail($autodate = true, $template_vars = false, Context $context = null)396. {397. $order = new Order($this->id_order);398. 399. if (!$this->add($autodate)) {400. return false;401. }402. 403. if (!$this->sendEmail($order, $template_vars)) {404. return false;685. // Switch to back order if needed686. if (Configuration::get('PS_STOCK_MANAGEMENT') && ($order_detail->getStockState() || $order_detail->product_quantity_in_stock <= 0)) {687. $history = new OrderHistory();688. $history->id_order = (int)$order->id;689. $history->changeIdOrderState(Configuration::get($order->valid ? 'PS_OS_OUTOFSTOCK_PAID' : 'PS_OS_OUTOFSTOCK_UNPAID'), $order, true);690. $history->addWithemail();691. }692. 693. unset($order_detail);694. 695. // Order is reloaded because the status just changed59. '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),60. '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),61. '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))62. );63. 64. $this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);65. 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);66. }67. }Argument [0]262Argument [1]10Argument [2]1317Argument [3]Przelew na kontoArgument [4]Argument [5]Array( [{bankwire_owner}] => coś tam [{bankwire_details}] => coś tam [{bankwire_address}] => gdzieś tam)Argument [6]3Argument [7]Argument [8]cb87962c479b1e768eb8db2d00ac1c94173. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {174. $this->setMedia();175. }176. 177. // postProcess handles ajaxProcess178. $this->postProcess();179. 180. if (!empty($this->redirect_after)) {181. $this->redirect();182. }183.362. if (isset($params_hook_action_dispatcher)) {363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);364. }365. 366. // Running controller367. $controller->run();368. } catch (PrestaShopException $e) {369. $e->displayMessage();370. }371. }372.Bardzo bym prosił o pomoc, zupełnie nie wiem jak to rozwiązać...
Link to comment
Share on other sites
15 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now