Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在产品详细信息页面magento中添加JS代码_Magento_Magento 1.7_Magento 1.9_Magento 1.8 - Fatal编程技术网

在产品详细信息页面magento中添加JS代码

在产品详细信息页面magento中添加JS代码,magento,magento-1.7,magento-1.9,magento-1.8,Magento,Magento 1.7,Magento 1.9,Magento 1.8,在安装插件的过程中,我希望在产品详细页面源代码中包含一段javascript代码。如何实现。如果要添加javascript代码,请在目录中的view.phtml中实现代码 app\design\frontend\youtheme\youtheme\template\catalog\product\view.phtml 在模块文件路径中添加以下代码:app/design/frontend/yourtheme/yourtheme/layout/modulename.xml,然后将js文件添加到皮肤

在安装插件的过程中,我希望在产品详细页面源代码中包含一段javascript代码。如何实现。

如果要添加javascript代码,请在目录中的
view.phtml
中实现代码

app\design\frontend\youtheme\youtheme\template\catalog\product\view.phtml

在模块文件路径中添加以下代码:app/design/frontend/yourtheme/yourtheme/layout/modulename.xml,然后将js文件添加到皮肤文件夹中,它将在产品视图页面标题中调用

<catalog_product_view>
    <reference name="head">
         <action method="addItem"><type>skin_js</type><name>js/yourjsfile.js</name></action>
    </reference>
<catalog_product_view>

skin_jsjs/yourjsfile.js