0

I have my site up and running but I am unable to get the checkout to work and I know why, but I do not know the fix.

<?php if($themeConfig->get("enable_ajaxcart")) { ?>
<script type="text/javascript">
        var ajaxCart = true;
</script>
<?php } ?>
<script type="text/javascript">
    var minicart_url = "<?php echo Mage::helper('ves_tempcp')->getMinicartURL(); ?>";
</script>

<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('calCustom/js/min/ecoWarrior.min.js');?>"></script>

The last two scripts are what run my menus however because they come after the getCssJsHtml() ?> it conflicts with my checkout however moving them before this stops my Menu from working and gets my checkout to work. I have heard of using the $.noConflict(); but I'm not getting anywhere and cant fathom it out.

The line causing the issue is getSkinUrl('calCustom/js/min/ecoWarrior.min.js');?>">

Can anyone offer any insight?

2 Answers 2

2

Finally got the answer, I had to open ecoWarrior.min.js and change all instances of $ to jQuery so noconflict worked fully.

also moving each to above <?php echo $this->getCssJsHtml() ?> stopped other error from occurring.

0

What error do you see in your developer tools console? If you're sure the conflict is in ecoWarrior.min.js then you can try this:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">jQuery.noConflict();</script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('calCustom/js/min/ecoWarrior.min.js');?>"></script>

I could give more specific insight if you provided your site's URL or the error that is being thrown by your browser's dev tools.

7
  • That allows the checkout to work perfectly but kills the menu. Error showing before your suggestion is> Uncaught TypeError: Cannot read property 'find' of null ecoWarrior.min.js:1 (anonymous function) ecoWarrior.min.js:1 j jquery.min.js:2 k.fireWith jquery.min.js:2 m.extend.ready jquery.min.js:2 J The error showing after the change is> Uncaught TypeError: undefined is not a function ecoWarrior.min.js:1 (anonymous function) ecoWarrior.min.js:1 Uncaught TypeError: undefined is not a function (index):862 (anonymous function) (index):862
    – Francis
    Commented Aug 5, 2014 at 15:54
  • Are you loading two versions of jQuery? Commented Aug 5, 2014 at 15:59
  • @ReidBlomquistI don't think so, I have not set a second one to be called. Just the one I have there in the head.
    – Francis
    Commented Aug 5, 2014 at 16:12
  • You may want to double check by looking in the developer console's resource tab. Here is some more info on the Uncaught TypeError: undefined is not a function issue: stackoverflow.com/questions/10429838/… Commented Aug 5, 2014 at 16:16
  • Oh you might be right, page source shows I am calling two. <script type="text/javascript" src="http://ecoliving.radiator2.local/js/venustheme/ves_tempcp/jquery/jquery.min.js"></script> and <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> My menu doesn't work if I dont cal the second one however. Not sure why and only if its where it currently is without a no.conflict affecting it.
    – Francis
    Commented Aug 5, 2014 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.