Marina M Posted July 15, 2015 Share Posted July 15, 2015 I´m testing my new store, and I get the followins errors when I try using the payment method cash on delivery. Can someone help me? I´m used to PHP. [PrestaShopException]Property OrderCartRule->name is emptyat line 872 in file classes/ObjectModel.php 867. 868. $message = $this->validateField($field, $this->$field);869. if ($message !== true)870. {871. if ($die)872. throw new PrestaShopException($message);873. return $error_return ? $message : false;874. }875. }876. 877. return true; ObjectModelCore->validateFields - [line 278 - classes/ObjectModel.php]273. *274. * @return array All object fields275. */276. public function getFields()277. {278. $this->validateFields();279. $fields = $this->formatFields(self::FORMAT_COMMON);280. 281. // For retro compatibility282. if (Shop::isTableAssociated($this->def['table']))283. $fields = array_merge($fields, $this->getFieldsShop()); ObjectModelCore->getFields - [line 486 - classes/ObjectModel.php]481. }482. 483. // Database insertion484. if (Shop::checkIdShopDefault($this->def['table']))485. $this->id_shop_default = min($id_shop_list);486. if (!$result = ObjectModel::$db->insert($this->def['table'], $this->getFields(), $null_values))487. return false;488. 489. // Get object id in database490. $this->id = ObjectModel::$db->Insert_ID();491. ObjectModelCore->add - [line 1090 - classes/order/Order.php]1085. {1086. $cart_rule = new CartRule($id_cart_rule);1087. $free_shipping = $cart_rule->free_shipping;1088. }1089. $order_cart_rule->free_shipping = (int)$free_shipping;1090. $order_cart_rule->add();1091. }1092. 1093. public function getNumberOfDays()1094. {1095. $nbReturnDays = (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS', null, null, $this->id_shop)); OrderCore->addCartRule - [line 589 - classes/PaymentModule.php] - [5 Arguments]584. 585. }586. $total_reduction_value_ti += $values['tax_incl'];587. $total_reduction_value_tex += $values['tax_excl'];588. 589. $order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping);590. 591. if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && !in_array($cart_rule['obj']->id, $cart_rule_used))592. {593. $cart_rule_used[] = $cart_rule['obj']->id;594. Argument [0]8Argument [1]Argument [2]Array( [tax_incl] => 3 [tax_excl] => 3)Argument [3]0Argument [4]0 PaymentModuleCore->validateOrder - [line 59 - modules/cashondelivery/controllers/front/validation.php] - [9 Arguments]54. 55. if (Tools::getValue('confirm'))56. {57. $customer = new Customer((int)$this->context->cart->id_customer);58. $total = $this->context->cart->getOrderTotal(true, Cart::BOTH);59. $this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);60. Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->module->id.'&id_order='.(int)$this->module->currentOrder);61. }62. }63. 64. /** Argument [0]129Argument [1]3Argument [2]96Argument [3]Pagamento na entrega (PNE)Argument [4]Argument [5]Array()Argument [6]Argument [7]Argument [8]c8552e8411f7e58eba2d98555340cd5c CashondeliveryValidationModuleFrontController->postProcess - [line 171 - classes/controller/Controller.php]166. // setMedia MUST be called before postProcess167. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className)))168. $this->setMedia();169. 170. // postProcess handles ajaxProcess171. $this->postProcess();172. 173. if (!empty($this->redirect_after))174. $this->redirect();175. 176. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) ControllerCore->run - [line 373 - classes/Dispatcher.php]368. // Execute hook dispatcher369. if (isset($params_hook_action_dispatcher))370. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);371. 372. // Running controller373. $controller->run();374. }375. catch (PrestaShopException $e)376. {377. $e->displayMessage();378. } DispatcherCore->dispatch - [line 28 - index.php] -------------------------------------------------------------------------------------------------------------------------------------- and the other error ------------------------------------------------------------------------------------------------------------------------------------------ [PrestaShopException]Property CartRule->name is emptyat line 913 in file classes/ObjectModel.php 908. 909. $message = $this->validateField($field, $value, $id_lang);910. if ($message !== true)911. {912. if ($die)913. throw new PrestaShopException($message);914. return $error_return ? $message : false;915. }916. }917. }918. ObjectModelCore->validateFieldsLang - [line 319 - classes/ObjectModel.php] ObjectModelCore->getFieldsLang - [line 511 - classes/ObjectModel.php] ObjectModelCore->add - [line 125 - classes/CartRule.php] - [2 Arguments] CartRuleCore->add - [line 105 - modules/referralprogram/ReferralProgramModule.php] ReferralProgramModule->registerDiscount - [line 70 - modules/referralprogram/ReferralProgramModule.php] - [3 Arguments] ReferralProgramModule->registerDiscountForSponsor - [line 515 - modules/referralprogram/referralprogram.php] - [1 Arguments] ReferralProgram->hookUpdateOrderStatus - [line 512 - classes/Hook.php] - [1 Arguments] HookCore::exec - [line 102 - classes/order/OrderHistory.php] - [7 Arguments] OrderHistoryCore->changeIdOrderState - [line 667 - classes/PaymentModule.php] - [3 Arguments] PaymentModuleCore->validateOrder - [line 59 - modules/cashondelivery/controllers/front/validation.php] - [9 Arguments] CashondeliveryValidationModuleFrontController->postProcess - [line 171 - classes/controller/Controller.php] ControllerCore->run - [line 373 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
vekia Posted July 16, 2015 Share Posted July 16, 2015 during the order process you used some cart rule? Link to comment Share on other sites More sharing options...
Marina M Posted July 16, 2015 Author Share Posted July 16, 2015 yes, then I thought this was the problem and deleted all cart rules, and also uninstalled the referral program module, and then the checkout worked all the times I tested. But I wish to use the referral program and cart rules. Link to comment Share on other sites More sharing options...
vekia Posted July 17, 2015 Share Posted July 17, 2015 seems like cart rule is generated without name can you please verify cart rule configuration? price rules > cart rules search there for the cart rule that you used and verify configuration does it contain name? Link to comment Share on other sites More sharing options...
Marina M Posted July 18, 2015 Author Share Posted July 18, 2015 The cart rules had no names, that was the problem! Thank you very much! Link to comment Share on other sites More sharing options...
vekia Posted July 21, 2015 Share Posted July 21, 2015 your problem is different and im affraid that it is not related to cart rule. Link to comment Share on other sites More sharing options...
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