Setup default currencies

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!
User avatar
PraveenJayakody
Posts: 7
Joined: 15 Nov 2022, 22:58

Setup default currencies

Post by PraveenJayakody » 15 Nov 2022, 23:11

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

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

Re: Setup default currencies

Post by aimeos » 16 Nov 2022, 10:21

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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
PraveenJayakody
Posts: 7
Joined: 15 Nov 2022, 22:58

Re: Setup default currencies

Post by PraveenJayakody » 18 Nov 2022, 02:40

Thank you for the fast reply. I used the `before()` function to run my custom code before the default setup file

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

Re: Setup default currencies

Post by aimeos » 18 Nov 2022, 07:31

Like said:
aimeos wrote: 16 Nov 2022, 10:21 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.
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, Image give us a star

Post Reply