hardcoder
hardcoder

Reputation: 184

Can we override core js file in Magento?

I want to override a Javascript function for the calendar widget in Magento. I want to change the timezone for the calendar based upon some configurations.

Is it possible to do so?

I know we can override CSS, PHP and PHTML files but I don't know how to do it for Javascript.

Upvotes: 0

Views: 528

Answers (1)

LapisLazuli
LapisLazuli

Reputation: 406

In layout files you can add js files to pages. (for example: app/design/frontend/default/your_theme/layout/page.xml). In the layout xml just replace the old js action with your own:

<!--<action method="addJs"><script>mage/some_script.js</script></action>-->
<action method="addJs"><script>your_js_folder/replacing_script.js</script></action>

The javascripts are often found in either of these two locations:

  • /skin/frontend/default/your_theme/js/

or just

  • /js

Upvotes: 1

Related Questions