AgustinCecotec Posted April 27, 2017 Share Posted April 27, 2017 I'm developing a module using some bootstrap code, and I want to know how I can use addCSS and addJS to add bootstrap core files inside the module and override the existing ones in case the theme is already using them...to avoid enqueuing duplicated files. Is there a way to do this? In Woocommerce it's possible to do cheking if the files are already enqueued or not, but I don't know if Prestashop has something similar. Link to comment Share on other sites More sharing options...
phinq1910 Posted April 28, 2017 Share Posted April 28, 2017 You can not check on prestashop. if really need, you can try search bootrap file on theme folder. Link to comment Share on other sites More sharing options...
AgustinCecotec Posted April 28, 2017 Author Share Posted April 28, 2017 Hi phinq1910, is that the only way to find if the file exists? if the user has a "custom" theme and the bootsrap files are in other place it will not find them and it will include mines. This way there will be duplicated files in the page.... Link to comment Share on other sites More sharing options...
vekia Posted April 28, 2017 Share Posted April 28, 2017 maybe some override that will check Media class for added is files by addJs command will do the job, but it will not work well if names will be different case its complicated, much more than it looks like Link to comment Share on other sites More sharing options...
AgustinCecotec Posted May 2, 2017 Author Share Posted May 2, 2017 Thanks Vekia I will search/try for other options, but I think there's not much to do with prestashop... I think the best way is to merge both methods...do a Media class override to check the files adeded by AddJs and if they not exist as the standard names...search them inside the most typical directories where we can found these files. 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