garcialopez Posted February 9, 2016 Share Posted February 9, 2016 Hi, I have created a new order state. Its call ''Transfer canceled". I want that it works as a the "canceled order state". In "canceled order state" the product increase his stock in 1. And in my new state the product decrease in 1. I think I have to edit the function checkProductStock in OrderDetail.php. Is it alright? There appear a 'PS_OS_CANCELED' state... how is it the name of my new state? Link to comment Share on other sites More sharing options...
garcialopez Posted February 9, 2016 Author Share Posted February 9, 2016 (edited) I have added my new id order state (11) in OrderDetail.php in checkProductStock function, but it doesn't work. Any idea? Please help! if($id_order_state != Configuration::get('PS_OS_CANCELED') && $id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state !=11) { ... //not decrease the stock } Edited February 9, 2016 by garcialopez (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted February 10, 2016 Share Posted February 10, 2016 Are you sure that part of the code is running? There are multiple instances of it. It's quite complex to find out the right one that decreases stock. I'd suggest trying to kill the script right before that, and see if it's running Link to comment Share on other sites More sharing options...
garcialopez Posted February 26, 2016 Author Share Posted February 26, 2016 The script works. I only need assign at my new state the same functionality that "cancerl order state" has. How can I do that? Link to comment Share on other sites More sharing options...
NemoPS Posted February 26, 2016 Share Posted February 26, 2016 There is a whole lot of code behind it, the easiest way is to just set the status to that.Otherwise you need to find every instance of PS_OS_CANCELED in prestashop, and see how it acts each time Link to comment Share on other sites More sharing options...
Rihab002 Posted July 27, 2016 Share Posted July 27, 2016 Hello, I have the same problem. Anyone can help us ? Thank you 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