How do I extend and override Order checkout page
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!
How do I extend and override Order checkout page
Hello,
I am new to Aimeos and I am trying to figure out things here with the checkout process and how does it really work.
I am trying to find what is the best way to override the checkout process basically after they reach to checkout/summary page and click on "Buy Now" button, how does this gets submitted and proceed? Which controller if I want to add my own code? how would I extend this
If you could guide me if will be great
Thanks
I am new to Aimeos and I am trying to figure out things here with the checkout process and how does it really work.
I am trying to find what is the best way to override the checkout process basically after they reach to checkout/summary page and click on "Buy Now" button, how does this gets submitted and proceed? Which controller if I want to add my own code? how would I extend this
If you could guide me if will be great
Thanks
Re: How do I extend and override Order checkout page
Have you read https://aimeos.org/docs/Developers/Html ... ut_process
It depends where you want to add your own code: before or after the redirect to the payment gateway.
It depends where you want to add your own code: before or after the redirect to the payment gateway.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How do I extend and override Order checkout page
Hello
Yes I have read it , there are some broken links and its hard to understand.
I am trying to see once the user clicks on "Buy Now" before the payment gateway, how can I intercept that and put my own code , where I grab the cart and do my own logic?
I read about extending the context like this : $context = \App::make('\Aimeos\Shop\Base\Context')->get();
Can I use that to grab the content of the current cart , and do my own custom method?
Please guide me through which files I need to modify or extend to do this
Thanks
Yes I have read it , there are some broken links and its hard to understand.
I am trying to see once the user clicks on "Buy Now" before the payment gateway, how can I intercept that and put my own code , where I grab the cart and do my own logic?
I read about extending the context like this : $context = \App::make('\Aimeos\Shop\Base\Context')->get();
Can I use that to grab the content of the current cart , and do my own custom method?
Please guide me through which files I need to modify or extend to do this
Thanks
Re: How do I extend and override Order checkout page
Where's the best place to add your extensions depends on what you are going to achieve. Please tell us more about what you want to implement.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 2
- Joined: 24 Apr 2017, 14:26
Re: How do I extend and override Order checkout page
We have the same question; we need to adjust some functionality which takes place in the following 2 files:
- /ext/ai-client-html/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php;
public function process();
we need to execute some code based on the order data and update automatically the order status to completed.
- /ext/ai-laravel/lib/custom/src/MShop/Customer/Manager/Laravel.php;
public function saveItem();
We need the created user in Aimeos to get the userdata and process it for further usage in our application.
We created an extension using the extension creator and see that there is a manifest file which includes the src folder of the extension ('client/html/src'), but the autoload_classmap does not contain files which are added in these folders. To be consistant, we added the same folder/file structure in the extension folder, so /ext/ourextension/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php is placed there and as OOP approach the following definition is used in the class
class Standard
extends \Aimeos\Client\Html\Checkout\Standard\Order\Standard
So everything should be in place, we debugged the bootstrap class in the aimeos-core and see that the manifest and folders are added as includes, but in the end the autoload file in the /vendor/composer/autoload_classmap.php is not updated with files from this ext. folder.
Any idea how to fix this so we can add our own logic to existing functions?
We did the dump-autoload command and the template files in our extension folder are getting loaded so the extension structure should be fine.
Hope to hear from you guys!
Peter
- /ext/ai-client-html/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php;
public function process();
we need to execute some code based on the order data and update automatically the order status to completed.
- /ext/ai-laravel/lib/custom/src/MShop/Customer/Manager/Laravel.php;
public function saveItem();
We need the created user in Aimeos to get the userdata and process it for further usage in our application.
We created an extension using the extension creator and see that there is a manifest file which includes the src folder of the extension ('client/html/src'), but the autoload_classmap does not contain files which are added in these folders. To be consistant, we added the same folder/file structure in the extension folder, so /ext/ourextension/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php is placed there and as OOP approach the following definition is used in the class
class Standard
extends \Aimeos\Client\Html\Checkout\Standard\Order\Standard
So everything should be in place, we debugged the bootstrap class in the aimeos-core and see that the manifest and folders are added as includes, but in the end the autoload file in the /vendor/composer/autoload_classmap.php is not updated with files from this ext. folder.
Any idea how to fix this so we can add our own logic to existing functions?
We did the dump-autoload command and the template files in our extension folder are getting loaded so the extension structure should be fine.
Hope to hear from you guys!
Peter
Re: How do I extend and override Order checkout page
Instead of overwriting the existing implementation, you canPeterEsser wrote: - /ext/ai-client-html/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php;
public function process();
we need to execute some code based on the order data and update automatically the order status to completed.
- add your own subpart: https://aimeos.org/docs/Developers/Html ... w_subparts
- add a decorator that dynamically extends the class: https://aimeos.org/docs/Developers/Html ... components
Maybe a job controller is the best place for this: https://aimeos.org/docs/Developers/Cont ... controllerPeterEsser wrote: - /ext/ai-laravel/lib/custom/src/MShop/Customer/Manager/Laravel.php;
public function saveItem();
We need the created user in Aimeos to get the userdata and process it for further usage in our application.
It doesn't work to name the class extending from itself. You need to rename it (e.g. "Ourproject") and configure the new class name of your class overwriting the standard implementation: https://aimeos.org/docs/Configuration/C ... order/namePeterEsser wrote: We created an extension using the extension creator and see that there is a manifest file which includes the src folder of the extension ('client/html/src'), but the autoload_classmap does not contain files which are added in these folders. To be consistant, we added the same folder/file structure in the extension folder, so /ext/ourextension/client/html/src/Client/Html/Checkout/Standard/Order/Standard.php is placed there and as OOP approach the following definition is used in the class
class Standard
extends \Aimeos\Client\Html\Checkout\Standard\Order\Standard
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: How do I extend and override Order checkout page
Hello, @aimeos,
I am using your suggested method by using this documentation.
https://aimeos.org/docs/Developers/Cont ... processors
I want to do some code after subscription creation so i need to override subscription method. I followed your method. but I cannot proceed further.
You have mentioned use this configuration option. Can you please help me where to configure my own created class.
And this configured class automatically will use my overridden function? Also when I do composer update will it be there and not removed?
I am using your suggested method by using this documentation.
https://aimeos.org/docs/Developers/Cont ... processors
I want to do some code after subscription creation so i need to override subscription
Code: Select all
end()
You have mentioned
Code: Select all
controller/common/subscription/process/processors = ['Cgroup']
And this configured class automatically will use my overridden function? Also when I do composer update will it be there and not removed?
Re: How do I extend and override Order checkout page
First, you need to create your own custom Aimeos extension for your own code (use the extension builder):
https://aimeos.org/docs/Developers/Create_an_extension
Then, the end() method is when a subscription is canceled or it reached its end date. If you want to add code after the subscription is created, use begin() instead.
The configuration should be in the ./config directory of your custom Aimeos extension in the controller.php file:
https://aimeos.org/docs/Developers/Create_an_extension
Then, the end() method is when a subscription is canceled or it reached its end date. If you want to add code after the subscription is created, use begin() instead.
The configuration should be in the ./config directory of your custom Aimeos extension in the controller.php file:
Code: Select all
return [
'common' => [
'subscription' => [
'process' => [
'processors' => ['Mylastclasspart']
]
]
]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star