How to add JS programmatically in Magento?

后端 未结 3 965
忘了有多久
忘了有多久 2021-01-31 23:53

I need to add a JS file conditionally and programmatically inside a block file. I tried with these codes:

if (Mage::getStoreConfig(\'mymodule/settings/enable\'))         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-01 00:12

    I know this was asked a long time ago, but in case somebody is looking for this, I would suggest to use this in your local.xml:

    
        
            
                
                    
                
            
         
    
    

    Of course this is for JS files located in /js/ folder. Use the appropriate method if you want to add skin_js or skin_css.

    PS. Tested on CE 1.9

提交回复
热议问题