Setup default currencies
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!
- PraveenJayakody
- Posts: 7
- Joined: 15 Nov 2022, 22:58
Setup default currencies
Hi,
I'm on Laravel 9, Aimeos 2022.x and PHP 8 on Mac.
When you run `php artisan aimeos:setup`, a bunch of currencies and locales are added to the database. I'm creating an extension so I want to change the currencies that would be added to the db when the setup command is run.
I created a Task in packages/<extension-name>/setup/default/MShopAddLocaleLangCurData2.php but it seems this is run after the original file therefore the changes in this file are not applied onto the db.
How do I get around this?
Any help is apprecciated,
TIA
I'm on Laravel 9, Aimeos 2022.x and PHP 8 on Mac.
When you run `php artisan aimeos:setup`, a bunch of currencies and locales are added to the database. I'm creating an extension so I want to change the currencies that would be added to the db when the setup command is run.
I created a Task in packages/<extension-name>/setup/default/MShopAddLocaleLangCurData2.php but it seems this is run after the original file therefore the changes in this file are not applied onto the db.
How do I get around this?
Any help is apprecciated,
TIA
Re: Setup default currencies
You can use the before() and after() methods of the setup tasks to specify when your setup task is executed:
https://aimeos.org/docs/latest/infrastr ... pendencies
Nevertheless, the MShopAddLocaleLangCurData will run and add its data regardless of what you do in your own setup task. You can only modify the data in the database after the task has been executed.
https://aimeos.org/docs/latest/infrastr ... pendencies
Nevertheless, the MShopAddLocaleLangCurData will run and add its data regardless of what you do in your own setup task. You can only modify the data in the database after the task has been executed.
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
- PraveenJayakody
- Posts: 7
- Joined: 15 Nov 2022, 22:58
Re: Setup default currencies
Thank you for the fast reply. I used the `before()` function to run my custom code before the default setup file
Re: Setup default currencies
Like said:
You have to add the dependency in after() and modify the already inserted data.
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