When I try to delete a line item in SpecialOrder.php it takes me back to the customer and will not delete the item, I also tried this weberp.org/weberp the demo location and it has the same issues.
Any help would be greatly appreciated
I don't have enough system info to test this, Dave, but in script includes/DefineSpecialOrderClass.php, at line 49, try removing the & operator from function remove_from_order to see if it helps this matter. [or not]
I noted that there might be another [tangent] side affect not covered, but try by removing the & operator first.
The other "side affect" for others that might read this post: ... in the SpecialOrder class, note that function add_to_order increases the LinesOnOrder count, but remove_from_order does not decrease the LinesOnOrder count, but probably should after the unset statement to maintain the actual line count.
(02-24-2017, 01:27 PM)TurboPT Wrote: I don't have enough system info to test this, Dave, but in script includes/DefineSpecialOrderClass.php, at line 49, try removing the & operator from function remove_from_order to see if it helps this matter. [or not]
I noted that there might be another [tangent] side affect not covered, but try by removing the & operator first.
The other "side affect" for others that might read this post: ... in the SpecialOrder class, note that function add_to_order increases the LinesOnOrder count, but remove_from_order does not decrease the LinesOnOrder count, but probably should after the unset statement to maintain the actual line count.
I have tried that and that had no affect the version I am using is 4.12.3 as I said before I have tried on the demo version on weberp.org and that has the same issue.
Thanks for all the help
Ok, so after looking into this further, it does not matter if the & operator is present, or not. The lines will still delete either way, with or without the operator. I'll likely remove it anyway since a simple line number value to be deleted does not need to be passed as a reference.
The other part about decreasing the LinesOnOrder was an initial assumption. (I did say 'probably should' in my first post to this thread)
I tried decreasing the lines during my testing, but doing so caused more issues, so I'll leave that alone. However, that being said, there are other ways to handle/manage the count without having to rely on bumping a variable, but this will take more thought.
After the 'Process This Order' button is clicked, the handling does NOT rely on the LinesOnOrder count, but processes over the LineItems array content instead. The LinesOnOrder is specifically used when adding lines to the order.
==========
The situation is that the identifier is not maintained with the delete link.
So, in file SpecialOrder.php, line 667 should be changed.
With that change, after clicking the 'Delete' link, the page does not 'jump' back out to the customer choice. Also, deleting line items are removed as expected.
I've attached the script with that change applied. Please check/try the script at your end (keep a backup of your current copy) to verify behavior before I commit to the repository.
Thanks for checking, Tim. Do you also agree about removing the & operator from the remove_from_order function in file includes/DefineSpecialOrderClass.php ?
Locally, I do have that operator removed, and it appears to be fine removing the line items.
(02-25-2017, 02:03 PM)TurboPT Wrote: Ok, so after looking into this further, it does not matter if the & operator is present, or not. The lines will still delete either way, with or without the operator. I'll likely remove it anyway since a simple line number value to be deleted does not need to be passed as a reference.
The other part about decreasing the LinesOnOrder was an initial assumption. (I did say 'probably should' in my first post to this thread)
I tried decreasing the lines during my testing, but doing so caused more issues, so I'll leave that alone. However, that being said, there are other ways to handle/manage the count without having to rely on bumping a variable, but this will take more thought.
After the 'Process This Order' button is clicked, the handling does NOT rely on the LinesOnOrder count, but processes over the LineItems array content instead. The LinesOnOrder is specifically used when adding lines to the order.
==========
The situation is that the identifier is not maintained with the delete link.
So, in file SpecialOrder.php, line 667 should be changed.
With that change, after clicking the 'Delete' link, the page does not 'jump' back out to the customer choice. Also, deleting line items are removed as expected.
I've attached the script with that change applied. Please check/try the script at your end (keep a backup of your current copy) to verify behavior before I commit to the repository.