Jump to content

Recommended Posts

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 empty
at 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 empty
at 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. 
Link to comment
Share on other sites

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

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

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...