News:

AbanteCart v1.4.2 is released.

Main Menu

store front api from extension

Started by talha, January 01, 2025, 04:18:50 AM

Previous topic - Next topic

talha

hi there, i have developed an extension for Teapplix.
case scenario: when order confirmed extension will send order information to teapplix. and similarly teapplix will send return back order updated information to our system via api.
extension is developed and sending order information to teapplix and what issue i am facing is the api url i created (where teapplix will send back order updated information) is giving the error the page you requested can not be found! .
please help how to create api url in extension
also i have added the file path in main.php file   

abolabo

please post path to your controller or even part of main.php with it.
This route must be a name of your controller class
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

talha

#2
$controllers = [
    'storefront' => [
        'extension/teapplix/notify'
    ],
    'admin'      => [],
];
this is main.php file's code
and this controller name ControllerExtensionTeapplixNotify
and this is file path where notify controller exists extensions/teapplix/storefront/controller/extension/teapplix/notify.php

class ControllerExtensionTeapplixNotify extends AController {
    public function index() {
      echo 'notify index function';
     }
}

abolabo

should be:
1. $controllers = array(
    'storefront' => array(
        'responses/extension/teapplix/notify'
    ),
);
Also move file to this route.
AbanteCart have only 5 types on controllers: common, blocks, pages, responses and task. If you create new one please place it into controller type directory first.
2. rename index() method to main()
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

Forum Rules Code of conduct
AbanteCart.com 2010 -