0

I am trying to put an Ajax form within the checkout process of Magento. I am having a slight issue though.

I have the form working as a sidebar on my sight, but I am having a conflict with one of the scripts that I found for my Ajax form. When I use it on the checkout page the onepage doesn't load like at all, but as soon as I remove it, it loads, but my form no longer changes like it should.

The working form can be seen here: https://www.therange702.com/gun-store.html

This is the script code that causes the conflict.

<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>

Whats inside that can be seen here -> https://www.therange702.com/js/jquery-1.2.6.pack.js

Sorry for the linking, the code in that is too big to put in here. I know this is the issue, cause if I remove the <Script> tag then it loads, but like i said my form no longer changes to the other part of it. I even removed the tag from the working form in the sidebar and it cause it to not work anymore.

I know it is a very old file, but I am new to ajax and I found a tutorial that I followed and used the source files that were provided. If you have suggestions for using a new file I am open to that too, maybe one that is actually understandable.

1

try replacing this

<script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script>

with

<script type="text/javascript" src="<?php echo Mage::getBaseUrl('js').'jquery-1.2.6.pack.js'?>"></script>
0

JQuery and prototype conflict on the $ variable. Append jQuery.noConflict(); to the jquery-1.2.6.pack.js file and don't use $ but jQuery in your other jQuery scripts.

You can use the $ in your functions like this:

var something = (function($) {
    $('#id'); // <-- jQuery object
} (jQuery));

var else = $('id'); <-- prototype object 

I don't know if this will solve your whole problem, but it will get you one step closer to the solution. Keep us posted on what happens next.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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