How to extend Controller Base file and add custom function

Help for integrating the Laravel package
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!
Dhara1510
Posts: 15
Joined: 27 Apr 2019, 05:36

How to extend Controller Base file and add custom function

Post by Dhara1510 » 01 May 2019, 07:55

Hello,

I am new to your package and I want to do some functionality with it by extending core features.

On create of subscription I want to do some update records on my database. I have found "createSubscriptions()" function inside

Code: Select all

ai-controller-frontend/controller/frontend/src/Controller/Frontend/Basket/Base.php
Now what I want is add my custom function at the end of this function. I didn't get proper documentation on how to do it. I also reviewed your document below link.
https://aimeos.org/docs/Developers/Cont ... processors

But do not get an idea of How to configure and use it. Where to configure it and how it will call my function. Can you please explain to me in detail as I don't find the proper configuration of it.

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: How to extend Controller Base file and add custom functi

Post by aimeos » 01 May 2019, 09:21

Configuration is explained here: laravel-package-f18/how-do-i-extend-and ... html#p7987

The job controller will loop over the configured subscription processors and execute their begin() method when you execute

Code: Select all

./artisan aimeos:jobs subscription/process/begin
You have to regularly execute the other job controllers in cronjobs too:
https://aimeos.org/docs/Laravel/Configure_cronjobs
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Dhara1510
Posts: 15
Joined: 27 Apr 2019, 05:36

Re: How to extend Controller Base file and add custom functi

Post by Dhara1510 » 01 May 2019, 10:40

Hello Aimeos,

Thanks for your kind reply.

I have searched in your package and found that on product purchase "createSubscriptions()" called which is located "ext/ai-controller-frontend/controller/frontend/src/Controller/Frontend/Basket/Base.php" so If I want to extend this file then how to configure in controller.php of extension.

If I extend it then will it automatically call my extension file??

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: How to extend Controller Base file and add custom functi

Post by aimeos » 02 May 2019, 11:36

No, that won't work. Please create a subscription processor and implement the begin() method to update the data you want.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply