Jump to content

[SOLUCIONADO] Error en cambio de Estado [PrestaShopException]


Recommended Posts

Hola a todos, cuando intentamos cambiar el estado de un pedido nos sale este error. Nos podrian ayudar.

 

Version Prestashop: 1.6.1.3

[PrestaShopException]

Property CartRule->name is empty
at line 954 in file classes/ObjectModel.php

949. }
950.
951. $message = $this->validateField($field, $value, $id_lang);
952. if ($message !== true) {
953. if ($die) {
954. throw new PrestaShopException($message);
955. }
956. return $error_return ? $message : false;
957. }
958. }
959. }
  • ObjectModelCore->validateFieldsLang - [line 295 - classes/ObjectModel.php]
    290. // Backward compatibility
    291. if (method_exists($this, 'getTranslationsFieldsChild')) {
    292. return $this->getTranslationsFieldsChild();
    293. }
    294.
    295. $this->validateFieldsLang();
    296. $is_lang_multishop = $this->isLangMultishop();
    297.
    298. $fields = array();
    299. if ($this->id_lang === null) {
    300. foreach (Language::getIDs(false) as $id_lang) {
  • ObjectModelCore->getFieldsLang - [line 511 - classes/ObjectModel.php]
    506. return false;
    507. }
    508.
    509. // Database insertion for multilingual fields related to the object
    510. if (!empty($this->def['multilang'])) {
    511. $fields = $this->getFieldsLang();
    512. if ($fields && is_array($fields)) {
    513. $shops = Shop::getCompleteListOfShopsID();
    514. $asso = Shop::getAssoTable($this->def['table'].'_lang');
    515. foreach ($fields as $field) {
    516. foreach (array_keys($field) as $key) {
  • ObjectModelCore->add - [line 129 - classes/CartRule.php] - [2 Arguments]
    124. {
    125. if (!$this->reduction_currency) {
    126. $this->reduction_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT');
    127. }
    128.
    129. if (!parent::add($autodate, $null_values)) {
    130. return false;
    131. }
    132.
    133. Configuration::updateGlobalValue('PS_CART_RULE_FEATURE_ACTIVE', '1');
    134. return true;
  • CartRuleCore->add - [line 105 - modules/referralprogram/ReferralProgramModule.php]
    100.         if (empty($cartRule->name))
    101.             $cartRule->name = 'Referral reward';
    102.         $cartRule->id_customer = (int)$id_customer;
    103.         $cartRule->reduction_currency = (int)$id_currency;
    104.
    105.         if ($cartRule->add())
    106.         {
    107.             if ($register != false)
    108.             {
    109.                 if ($register == 'sponsor')
    110.                     $this->id_cart_rule_sponsor = (int)$cartRule->id;
  • ReferralProgramModule->registerDiscount - [line 70 - modules/referralprogram/ReferralProgramModule.php] - [3 Arguments]
    65.
    66.     public function registerDiscountForSponsor($id_currency)
    67.     {
    68.         if ((int)$this->id_cart_rule_sponsor > 0)
    69.             return false;
    70.         return $this->registerDiscount((int)$this->id_sponsor, 'sponsor', (int)$id_currency);
    71.     }
    72.
    73.     public function registerDiscountForSponsored($id_currency)
    74.     {
    75.         if (!(int)$this->id_customer OR (int)$this->id_cart_rule > 0)
  • ReferralProgramModule->registerDiscountForSponsor - [line 515 - modules/referralprogram/referralprogram.php] - [1 Arguments]
    510.         $nbOrdersCustomer = (int)$stats['nb_orders'] + 1; // hack to count current order
    511.         $referralprogram = new ReferralProgramModule(ReferralProgramModule::isSponsorised((int)($customer->id), true));
    512.         if (!Validate::isLoadedObject($referralprogram))
    513.             return false;
    514.         $sponsor = new Customer((int)$referralprogram->id_sponsor);
    515.         if ((int)$orderState->logable AND $nbOrdersCustomer >= (int)$this->_configuration['REFERRAL_ORDER_QUANTITY'] AND $referralprogram->registerDiscountForSponsor((int)$order->id_currency))
    516.         {
    517.             $cartRule = new CartRule((int)$referralprogram->id_cart_rule_sponsor);
    518.             $currency = new Currency((int)$order->id_currency);
    519.             $discount_display = ReferralProgram::displayDiscount( (float) $cartRule->reduction_percent ? (float) $cartRule->reduction_percent : (int) $cartRule->reduction_amount, (float) $cartRule->reduction_percent ? 1 : 2, $currency);            $data = array('{sponsored_firstname}' => $customer->firstname, '{sponsored_lastname}' => $customer->lastname, '{discount_display}' => $discount_display, '{discount_name}' => $cartRule->code);
    520.             Mail::Send((int)$order->id_lang, 'referralprogram-congratulations', Mail::l('Congratulations!', (int)$order->id_lang), $data, $sponsor->email, $sponsor->firstname.' '.$sponsor->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
  • ReferralProgram->hookUpdateOrderStatus - [line 587 - classes/Hook.php] - [1 Arguments]
    582. }
    583. }
    584.
    585. // Immediately return the result if we do not log performances
    586. if (!Module::$_log_modules_perfs) {
    587. return $module->{$method}($params);
    588. }
    589.
    590. // Store time and memory before and after hook call and save the result in the database
    591. $time_start = microtime(true);
    592. $memory_start = memory_get_usage(true);
  • HookCore::coreCallHook - [line 544 - classes/Hook.php] - [3 Arguments]
    539.
    540. // Call hook method
    541. if ($hook_callable) {
    542. $display = Hook::coreCallHook($moduleInstance, 'hook'.$hook_name, $hook_args);
    543. } elseif ($hook_retro_callable) {
    544. $display = Hook::coreCallHook($moduleInstance, 'hook'.$retro_hook_name, $hook_args);
    545. }
    546.
    547. // Live edit
    548. if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad')
    549. && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'
  • HookCore::exec - [line 105 - classes/order/OrderHistory.php] - [7 Arguments]
    100. if (in_array($new_os->id, array(Configuration::get('PS_OS_PAYMENT'), Configuration::get('PS_OS_WS_PAYMENT')))) {
    101. Hook::exec('actionPaymentConfirmation', array('id_order' => (int)$order->id), null, false, true, false, $order->id_shop);
    102. }
    103.
    104. // executes hook
    105. Hook::exec('actionOrderStatusUpdate', array('newOrderStatus' => $new_os, 'id_order' => (int)$order->id), null, false, true, false, $order->id_shop);
    106.
    107. if (Validate::isLoadedObject($order) && ($new_os instanceof OrderState)) {
    108. $context = Context::getContext();
    109.
    110. // An email is sent the first time a virtual item is validated
  • OrderHistoryCore->changeIdOrderState - [line 531 - controllers/admin/AdminOrdersController.php] - [3 Arguments]
    526.
    527. $use_existings_payment = false;
    528. if (!$order->hasInvoice()) {
    529. $use_existings_payment = true;
    530. }
    531. $history->changeIdOrderState((int)$order_state->id, $order, $use_existings_payment);
    532.
    533. $carrier = new Carrier($order->id_carrier, $order->id_lang);
    534. $templateVars = array();
    535. if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number) {
    536. $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url));
  • AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
    173. if (!$this->content_only && ($this->display_header || (isset($this->className) && $this->className))) {
    174. $this->setMedia();
    175. }
    176.
    177. // postProcess handles ajaxProcess
    178. $this->postProcess();
    179.
    180. if (!empty($this->redirect_after)) {
    181. $this->redirect();
    182. }
    183.
  • ControllerCore->run - [line 367 - classes/Dispatcher.php]
    362. if (isset($params_hook_action_dispatcher)) {
    363. Hook::exec('actionDispatcher', $params_hook_action_dispatcher);
    364. }
    365.
    366. // Running controller
    367. $controller->run();
    368. } catch (PrestaShopException $e) {
    369. $e->displayMessage();
    370. }
    371. }
    372.
  • DispatcherCore->dispatch - [line 58 - admin/index.php]
    53. if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
    54. $_REQUEST['controller'] = strtolower($_REQUEST['tab']);
    55. }
    56.
    57. // Prepare and trigger admin dispatcher
    58. Dispatcher::getInstance()->dispatch();
Edited by ivanson7 (see edit history)
Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...