Page 1 of 1
Why does jQuery work only in the home?
Posted: Tue Jun 28, 2011 3:58 pm
by proxisoft.net
I put this piece of code in the header.tpl but it works only in the homepage. Why?

(I'm using OC 1.4.9.3)
Code: Select all
<script type="text/javascript">
$(document).ready(function(){
$('#module_cart').insertAfter('.box');
});
</script>
Re: Why does jQuery work only in the home?
Posted: Tue Jun 28, 2011 7:01 pm
by SXGuy
Place that code in the view file that relates to #module_cart and not the header.tpl file.
Header.tpl file should contain the link to the javascript file that uses this function.
So if its the cart module you wish to change, place that code in catalog/view/theme/yourtheme/template/module/cart.tpl
Re: Why does jQuery work only in the home?
Posted: Wed Jun 29, 2011 3:17 pm
by proxisoft.net
I've tried your solution putting the code in cart.tpl BUT it doesn't work properly. As I said, it works only in the home page and NOT on the other pages.
Re: Why does jQuery work only in the home?
Posted: Thu Jun 30, 2011 4:03 pm
by proxisoft.net
The piece of code I put here is only an example you can cut & paste into an installation of OC 1.4.x because uses two divs already present.