Prestashop 1.7 JS files not being added

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:30:53

问题


Working on Prestashop 1.7 and updated my theme.yml file to look like the below but it doesn't add in the file. The file is in that directory but it isn't being pulled in. Any suggestions to the code? I want to include the JS file but it isn't being pulled in.

assets:
  # If you're using this theme as child and you want to load
  # the parent theme assets, uncomment this line.
  # use_parent_assets: true

  # The following lines are showing how to load assets in your page
  # Uncomment and change value to start loading css or js files
 css:
   all:
     - id: theme-custom
       path: assets/css/custom.css
#    product:
#      - id: product-style
#        path: assets/css/product.css
#        media: all
#        priority: 200
 js:
   all:
      - id: slick
        path: assets/js/external-lib.js
        priority: 30
        position: bottom
   cart:
     - id: theme-custom
       path: assets/js/custom.js

回答1:


You need to mannually delete or rename the file

config/themes/{theme_name}/shop{shopid}.json

It has priority ove that one. It's already reported and solved for 1.7.1. Then the code in your assets will be added to the cached one (to reduce the number of file loading).



来源:https://stackoverflow.com/questions/42141685/prestashop-1-7-js-files-not-being-added

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!