We called function setproductlogin in app/design/frontend/rwd/Theme/template/catalog/product list.phtml :
<div onclick="setproductlogin('<?php echo $_product->getEntityId()?>');setrequestlogin();">
like</div>
and function setproductlogin script code is present in
app/design/frontend/rwd/Theme/template/productlike - index.phtml
<script type="text/javascript">
function setproductlogin(pid)
{
document.getElementById("likeproduct_id").value=pid;
jQuery("#productlistlogin").trigger("click");
}
</script>
app/design/frontend/rwd/Theme/layout/productlike.xml :
<reference name="before_body_end">
<block type="core/template" name="ajaxlogin">
<action method="setTemplate"><template>productlike/index.phtml</template></action>
</block>
</reference>
We used same function in another theme [ Theme6] file app/design/frontend/rwd/Theme6/template/aitcg - js_styles1.phtml
<button onclick="return setproductlogin(\'<?php echo Mage::registry("current_product")->getId()?>\', event);setrequestlogin();" id="submit-editorApply-{{rand}}" >
SAVE DESIGN
</button>
we included same function code in same theme file as
app/design/frontend/rwd/Theme6/template/example/index.phtml ,
but still when we click "save design" button, its calling javascript function present in main theme [Theme] instead of related theme Theme6
layout file :
<reference name="content">
<block type="example/list" name="examplelist" template="example/index.phtml" />
</reference>
app/design/frontend/rwd/Theme6/template/productlike - index.phtml