mantas393 Posted May 14, 2019 Share Posted May 14, 2019 (edited) Hi, One of the core files classes/stock/StockAvailable.php contains: class StockAvailableCore extends ObjectModel { public static function getQuantityAvailableByProduct($id_product = null, $id_product_attribute = null, $id_shop = null) { ... } ... } I want to call this getQuantityAvailableByProduct() method from my module. So I tried to include this class, extend it and call method like this: <?php require_once('../../src/Core/Foundation/Database/EntityInterface.php'); require_once('../../classes/ObjectModel.php'); require_once('../../classes/stock/StockAvailable.php'); $MyClass = new StockAvailableCore(); $MyClass->getStockAvailableIdByProductId($id); And the error that I'm getting: PHP Fatal error: Uncaught Error: Class 'ObjectModel' not found in /home/mantas/Server/honey/classes/stock/StockAvailable.php:34 What am i missing? And Is this the correct way to extend a class and call method? Edited May 14, 2019 by mantas393 (see edit history) Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted May 15, 2019 Share Posted May 15, 2019 Hi... call like this $getQuantityAvailableByProduct = StockAvailable::getQuantityAvailableByProduct($id_product = null, $id_product_attribute = null, $id_shop = null) 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