Jump to content

Error when adding negative percentage reduction (fee)


RabbitZzZ

Recommended Posts

Hi,

I rund PS 1.6.1.9 (recently updated from 1.6.0.14).

When I want to add a negative percentage reduction (so to say a percentage fee) to an order from the backoffice, I get the following error thrown:

[PrestaShopException]

Property CartRule->reduction_percent is not valid
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. 
ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]
ObjectModelCore->getFields - [line 487 - classes/ObjectModel.php]
ObjectModelCore->add - [line 129 - classes/CartRule.php] - [2 Arguments]
CartRuleCore->add - [line 1459 - controllers/admin/AdminOrdersController.php]
AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
ControllerCore->run - [line 367 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 58 - admin/index.php]

If it's a fixed amount (also negative) it works. Is there a way to fix this in the code?

Thanks a lot!

Link to comment
Share on other sites

Now I also get the error message with fixed amounts! 

Please help, this is really bad!

[PrestaShopException]

Property Order->total_discounts is not valid
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. 
ObjectModelCore->validateFields - [line 246 - classes/ObjectModel.php]
ObjectModelCore->getFields - [line 304 - classes/order/Order.php]
OrderCore->getFields - [line 652 - classes/ObjectModel.php]
ObjectModelCore->update - [line 1487 - controllers/admin/AdminOrdersController.php]
AdminOrdersControllerCore->postProcess - [line 178 - classes/controller/Controller.php]
ControllerCore->run - [line 367 - classes/Dispatcher.php]
DispatcherCore->dispatch - [line 58 - admin/index.php]
Edited by RabbitZzZ (see edit history)
Link to comment
Share on other sites

Hi there,

 

I don't know about previous version, but I'm pretty sure it does not work on PS 1.6.

As for a module that does this, I can suggest this one:

 

http://addons.prestashop.com/en/12794-fees-and-reductions-shipping-surcharge.html

 

But I also suggest you to check if there is something that better fits your needs in the Addons.

 

I hope this helps, have a nice day,

Federica

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