How can i override controller and his method by my extantion
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
How can i override controller and his method by my extantion
Hi aimeos,
Basically i am creating my own extantion. i have followed following this link.
https://aimeos.org/docs/Developers/Create_an_extension
And i got result for only views but i want to override your controllers, method, Classes e.t.c but i am not getting result. it execute all logic from ai-client-html but i want to execute from my extention.
Please kindly help me and Thank you in advance.
Best Regaurds,
Kishan Upadhyay
Basically i am creating my own extantion. i have followed following this link.
https://aimeos.org/docs/Developers/Create_an_extension
And i got result for only views but i want to override your controllers, method, Classes e.t.c but i am not getting result. it execute all logic from ai-client-html but i want to execute from my extention.
Please kindly help me and Thank you in advance.
Best Regaurds,
Kishan Upadhyay
Re: How can i override controller and his method by my extan
Create a class with another name (namespace is the same as the existing class you want to overwrite), extend from the existing class and overwrite the methods you need. Then, configure the name of your new class e.g. for the catalog lists component: https://aimeos.org/docs/Configuration/C ... lists/name
You can also dynamically extend classes with decorators to add additional data for example:
https://aimeos.org/docs/Developers/Html ... components
You can also dynamically extend classes with decorators to add additional data for example:
https://aimeos.org/docs/Developers/Html ... components
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: How can i override controller and his method by my extan
Thank you for replay aimeos and i have try as per your instruction and it worked.
One last thing that how you get data from database. i want to learn that how can i get data from database and make my own thing as per requirement. and thank you in advance.
Best Regards,
Kishan Upadhyay
One last thing that how you get data from database. i want to learn that how can i get data from database and make my own thing as per requirement. and thank you in advance.
Best Regards,
Kishan Upadhyay
Re: How can i override controller and his method by my extan
Use the Aimeos frontend controllers to get the data you need:
https://github.com/aimeos/ai-controller ... r/Frontend
https://github.com/aimeos/ai-controller ... r/Frontend
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: How can i override controller and his method by my extan
Thank you aimeos for your support. Is there any config settings remains for this i apply frontend controllers in my extension but yet he executes from ai-controller-frontend.
Best Regards,
Kishan Upadhyay
Best Regards,
Kishan Upadhyay
Re: How can i override controller and his method by my extan
Like all other classes you want to overwrite in Aimeos, you have to give yours a new name and configure that name e.g. for the product controller:
https://aimeos.org/docs/Configuration/C ... oduct/name
https://aimeos.org/docs/Configuration/C ... oduct/name
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 16
- Joined: 20 Jun 2019, 10:16
Re: How can i override controller and his method by my extan
Hi Aimeos after following your step from documentation i getting this error. If you help me on this.
Best Regards,
Kishan Upadhyay
Best Regards,
Kishan Upadhyay
- Attachments
-
- Final Error i get is this.
- Screenshot_3.jpg (198.31 KiB) Viewed 11835 times
-
- see this class that i have made and name of file are alos same
- Screenshot_2.jpg (188.45 KiB) Viewed 11835 times
-
- Shop.php file
- Screenshot_1.jpg (65.08 KiB) Viewed 11835 times
Re: How can i override controller and his method by my extan
Please make sure you are using the right interface for your installed version. Currently, you've installed Aimeos 2018.10 which uses this interface: https://github.com/aimeos/ai-controller ... ce.php#L78
But your class implements the newer 2019.04 interface: https://github.com/aimeos/ai-controller ... /Iface.php
The frontend controller interfaces have been rewritten in 2019.x to be much more intuitive and easier to use. If you want to implement your own frontend controllers, you should use Aimeos 2019.04+
But your class implements the newer 2019.04 interface: https://github.com/aimeos/ai-controller ... /Iface.php
The frontend controller interfaces have been rewritten in 2019.x to be much more intuitive and easier to use. If you want to implement your own frontend controllers, you should use Aimeos 2019.04+
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 48
- Joined: 30 Apr 2023, 12:46
Re: How can i override controller and his method by my extantion
@aimoes
all links is outdated , Please how i can overwrite aimeos-laravel/src/Controller/CheckoutController.php in my Extension?
all links is outdated , Please how i can overwrite aimeos-laravel/src/Controller/CheckoutController.php in my Extension?