Not allowed to access configuration
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!
Not allowed to access configuration
i am trying to write my own config setting and read it from my custom body template.
Side question: i have defined my template body like this (shop.php):
i thought just leaving it in the right directory will load that template?! that is without specifying the directory in shop.php like i did above. That is for extensions. See here https://aimeos.org/docs/Developers/Html ... _templates
anyway:
when adding a config:
and then accessing it in my address-billing-body-default.php results in
Side question: i have defined my template body like this (shop.php):
Code: Select all
'client' => array(
'html' => array(
'checkout' => array(
'standard' => array(
'address' => array(
'standard' => array(
'template-body' => array(
__DIR__ . "/../ext/cmc-usa-salestax-by-state/client/html/templates/checkout/standard/address-billing-body-default.php"
)
)
anyway:
when adding a config:
Code: Select all
'mshop' => array(
'price' => array(
'taxflag' => 0,
'shoplocatedinusa' => 1,
)
)
Not allowed to access "mshop/price/shoplocatedinusa" configuration
Re: Not allowed to access configuration
That's right, it's enough to copy the template in your extension into the ./client/html/templates/checkout/standard/ directory. The only thing I'm currently thinking about is if it's necessary to have this in the manifest.php of your extension to ensure your extension templates are loaded after that of ai-client-html:jossnaz wrote: i thought just leaving it in the right directory will load that template?! that is without specifying the directory in shop.php like i did above. That is for extensions. See here https://aimeos.org/docs/Developers/Html ... _templates
Code: Select all
'depends' => array(
'aimeos-core',
'ai-client-html',
),
Within the ai-client-html, you can only access configuration settings starting with "client/". This is enforced by the "Protect" config decorator and should prevent developers from trying to retrieve the database credentials and execute SQL in the templatesjossnaz wrote: when adding a config:Code: Select all
'mshop' => array( 'price' => array( 'taxflag' => 0, 'shoplocatedinusa' => 1, ) )
Not allowed to access "mshop/price/shoplocatedinusa" configuration
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: Not allowed to access configuration
seems too restrictive to me.
I hope i can access the config from my plugin... say, to check that the user has set the configuration correctly before proceeding to do stuff.
I hope i can access the config from my plugin... say, to check that the user has set the configuration correctly before proceeding to do stuff.
Re: Not allowed to access configuration
If you want to add own configuration for your templates, please use the prefix "client/html/_..." instead. The "mshop/..." configuration settings are only for the data access layer in "./lib/mshoplib" of the Aimeos core.
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