Jump to content

Unable to get the right context with console


Recommended Posts

Hello :)

When I run the following command (which is used to regenerate the email files) via the console, the shop context is not the right one :

php bin/console prestashop:mail:generate myThemeName Locale "themes/myThemeName/mails" --overwrite --id_shop=4

From a multi-store PrestaShop, I have to regenerate the emails of each store with the right context.

I use the ActionBuildMailLayoutVariables hook to transfer the media server adress used by the store.

I placed a dump(Context::getContext()->shop->id); within my hook. When I use the BO > Improve > Design > MailTheme, the context is the right one (I get 4). However, if I use the above command, the returned context is always 1.  Why does the --id_shop=4 parameter not seem to be used ?

Edited by Loraga (see edit history)
Link to comment
Share on other sites

  • Loraga changed the title to Unable to get the right context with console

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...