I am trying to add facebook pixel code in particular category.How can i add that js file in magento please help me.
1 Answer
1.) create a template file with you FB pixel code and put it into
app/design/frontend/THEME/PACKAGE/template/your_file.phtml
2.) add a block to layout with your modules layout.xml or local.xml in
app/design/frontend/THEME/PACKAGE/layout/
<CATEGORY_{id}>
<reference name="before_body_end">
<block type="core/template" name="fb.pixel">
<action method="setTemplate">
<template>your_file.phtml</template>
</action>
</block>
</reference>
</CATEGORY_{id}>
Or
You can do the same from backend ... "Admin - Catalog - Manage Categories" and paste code from above (without <CATEGORY_{id}>
) into categories "Custom Layout Update" section.
See your other questions belongs to Magento2 ... this is for M1, but it should work similiar there.