Why can't I call the methods defined in system/library/cart.php from the controller files for the admin panel?
Examples:
1) Trying to call $this->cart->clear(); from admin/controller/sale/order.php produces an error, as if the method didn't exist.
2) On the other hand $this->session->getId(); works fine when called from the same place.
3) When $this->cart->clear(); is called from catalog/controller/api/cart.php it works fine.
My OpenCart Version is 2.0.3.1.
The cart library is not loaded into the registry in the admin application, you should use the API as you mention to interact with a customers cart from the admin panel.
Daveyoi, thank you for the reply! Yes, indeed the cart library isn't loaded in admin/index.php as it is loaded in the main index file for the catalog.
Who is online
Users browsing this forum: No registered users and 311 guests