jibonbokul Posted May 22, 2019 Share Posted May 22, 2019 (edited) 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 May 22, 2019 by jibonbokul (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted May 23, 2019 Share Posted May 23, 2019 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. 1 Link to comment Share on other sites More sharing options...
jibonbokul Posted May 26, 2019 Author Share Posted May 26, 2019 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 More sharing options...
NemoPS Posted May 26, 2019 Share Posted May 26, 2019 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 More sharing options...
jibonbokul Posted May 28, 2019 Author Share Posted May 28, 2019 (edited) 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 May 28, 2019 by jibonbokul (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted May 29, 2019 Share Posted May 29, 2019 For the global variable, I guess you can use custom.js and set it with window.nameofthevariable = ... Link to comment Share on other sites More sharing options...
jibonbokul Posted May 30, 2019 Author Share Posted May 30, 2019 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 More sharing options...
NemoPS Posted May 30, 2019 Share Posted May 30, 2019 I am not sure you can add javascript functions. Values can be added with Media::AddJsDef('name', 'value'); Link to comment 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