Wednesday 26 October 2016

How to add js in magento


There is a two way to add js in magento module


/projectname/skin/frontend/base/default/js/myproduct.js

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
   <catalog_product_view>
       <reference name="head">
           <action method="addItem">
               <type>skin_js</type><name>js/myproduct.js</name>
           </action>
       </reference>
   </catalog_product_view>
</layout>

2. /projectname/js/myproduct.js

<layout version="0.1.0">
   <catalog_product_view translate="label">
       <reference name="head">
           <action method="addJs"><script>myproduct.js</script></action>
        </reference>        
   </catalog_product_view>
</layout>

I hope it will work for you. Good Luck

If you have any query then feel free to contact me at Jainish Senjaliya

What is Magento

Magento is a very powerful and ecommerce platform built on open source technology which provides online merchants with a flexible and smooth shopping cart system, created by Varien

Magento is a fast growing ecommerce script. It is an open-source platform using Zend PHP and MySQL databases. Magento control over the look, content and functionality of their online store. Magento offers great flexibility through its modular architecture, is completely scalable and has a wide range of control options that its users appreciate.

Magento offers powerful marketing, search engine optimization, and catalog-management tools.

I believe that Magento is one of the best ecommerce platforms available today

What is TYPO3

TYPO3 is a free, open source content management framework designed to simplify the creation of feature-rich websites that can be updated by nontechnical editors. It is written in PHP and is compatible with a number of popular databases, including MySQL.

TYPO3 is a small to midsize enterprise-class Content Management Framework offering the best of both worlds: out-of-the-box operation with a complete set of standard modules and a clean and sturdy high-performance architecture accomodating virtually every kind of custom solution or extension.

For authors, TYPO3 is a user-friendly, intuitive tool, allowing content editors to produce and maintain web pages, using sophisticated functions in just a few clicks of the mouse.

With TYPO3, everyone can participate in web-based communication and customer relations. Seamless integration of multimedia content types and dynamic server-side image manipulation and generation are among the numerous standard options inside this comprehensive toolbox for web-based communication. Also included is an internal messaging and workflow communication system for shared authoring and collaboration.

For administrators and content managers, TYPO3 features an extremely detailed user permissions system for implementing professional content creation and editing workflows. TYPO3 is a server-side platform-independent application that can be used with virtually every browser available.

Web developers and agencies will appreciate the complete separation of design and content. TYPO3 does not limit the design options expected by professional website designers and site redesigns are easily accommodated.

TYPO3 is database-driven and scales easily to deliver web pages and embedded formats in an enterprise content providing environment.

TYPO3 is open source software published under the GPL.