Jump to content

Create global variable accessible through all templates in PrestaShop 1.7


jibonbokul

Recommended Posts

Create global variable accessible through all templates in PrestaShop 1.7 .

my PrestaShop 1.7 theme setting panel global variable not working on templates . showing undefined but working fine on 1.6

 

new version i can't  access  my theme setting module data to all template

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

On 5/23/2019 at 7:46 PM, NemoPS said:

You mean you are using a 1.6 theme on 1.7? If so, it's perfectly normal it doesn't work, you need a new one.

No Buddy . i have use new theme but our theme option panel module  global variable working fine on 1.6 but when i have to call on 1.7 doesn't working.  showing undefined variable . do you know? any option to make any custom global variable use for all theme tpl file ..

Link to comment
Share on other sites

It really depends on the theme so it's hard to tell what's going on. Are you sure it's still called the same way, or still available? I think the fastest route to get an answer now is to ask the theme  devs

Link to comment
Share on other sites

On 5/26/2019 at 7:44 PM, NemoPS said:

It really depends on the theme so it's hard to tell what's going on. Are you sure it's still called the same way, or still available? I think the fastest route to get an answer now is to ask the theme  devs

Thanks for  your nice comment . yes i will share you my function with global variable code ..for check.

 

Also do you know how to create global variable for all theme TPL file ..Prestashop 1.7

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

18 hours ago, NemoPS said:

For the global variable, I guess you can use custom.js and set it with window.nameofthevariable = ...

This is not possible to call from custom.js  because our theme all featured called from option panel so need to call from php function page 

Link to comment
Share on other sites

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...