Spouter Posted December 15, 2021 Posted December 15, 2021 I see in PS code some prestashop variables in <head> section. For example "var prestashop". Than i can access these variables in js files for example "prestashop.currency.iso_code" will print "EUR" in my case. But how can I add new variables? I need to add all available currencies with conversions rates. Share this post Link to post Share on other sites More sharing options...
Spouter Posted December 15, 2021 Posted December 15, 2021 As always - this forum is dead... Maybe it help someone: public function hookHeader($params) { Media::addJsDef( array( 'currency_id' => (int)$this->context->currency->id, 'conversion_rate' => Context::getContext()->currency->getConversionRate(), ) ); } Share this post Link to post Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now