AbanteCart Development > API Development
how to load model from other controller?
huyhoang08:
thank you, i sloved my issue, i think PHP model file should have only _ in file name
Tishbyte:
Hi,
I know this thread is a bit old, but I had a similar question for an extension I am working on.
I am trying to call a function from a different model to delete a product, but as soon as I use that syntax, everything breaks.
--- Code: ---$this->load->model('catolog/product');
$this->model_catalog_product->deleteProduct((int)$id);
--- End code ---
Error:
load error: AbanteCart core v.1.2.13 Error: Could not load model catolog/product from /home/####/####.com/####/extensions/####/admin/model/catalog/####.php on line 47 in <b>/home/####/####.com/####/core/engine/loader.php</b> on line <b>120</b>
Am I doing something wrong?
dvagner:
try this:
$that = $this->baseObject;
$that->load->model(....);
$that->model_......
maxter:
--- Quote from: dvagner on February 20, 2019, 01:08:18 AM ---try this:
$that = $this->baseObject;
$that->load->model(....);
$that->model_......
--- End quote ---
If you do this inside of the ext. hook file, it is correct
Tishbyte:
Now I am receiving different errors.
AbanteCart core v.1.2.13 Call to a member function model() on null in ######
Does anyone know of any useful tutorials for making extensions in Abantecart? The developer's guide provided is very limited.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version