ravspw1 Posted November 12, 2022 Share Posted November 12, 2022 Hello, Attempts to limit the order list view for a given employee. I managed to make a constraint for a given order status: in the file: controllers/admin/AdminOrdersController.php if($this->context->employee->id_profile == 6) { $this->_where .= ' AND os.id_order_state = 2'; } This works, but I'd like to further restrict based on the city: $this->_where .= ' AND os.id_order_state = 2' AND (a.`city` LIKE "Janniehaven%"); but it doesn't work 😕 Link to comment Share on other sites More sharing options...
lordignus Posted November 16, 2022 Share Posted November 16, 2022 You've got a quote in the wrong place there... $this->_where .= ' AND os.id_order_state = 2' AND (a.`city` LIKE "Janniehaven%"); Should be: $this->_where .= ' AND os.id_order_state = 2 AND (a.`city` LIKE "Janniehaven%")'; Link to comment Share on other sites More sharing options...
ravspw1 Posted December 13, 2022 Author Share Posted December 13, 2022 @lordignus Thank you very much, I'd like to do that for products as well but $this->_where .= ' AND id_product = 20'; not work 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