Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: Ajax Shipping Estimator ML9

  1. #1
    cc9537 is offline Member
    Join Date
    May 2009
    Posts
    40

    Default Ajax Shipping Estimator ML9

    Is is possible to get the Ajax Shipping Estimator to work in ML V9?

    If I added revAjax.js I get an error about the TopSearchForm not being an object or is null,

    If I take out revAjax.js I don't get the error, but it does not work.

    It does not work either way, with or without the revAjax.js.

    Any one got it working? Any ideas?

  2. #2
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    Try commenting the Set Focus to SearchBox code in the revajex.js and see if that works. Should be around line 244.

    Hope this helps

  3. #3
    cc9537 is offline Member
    Join Date
    May 2009
    Posts
    40

    Default Well, um

    Thanks for your reply. That took care of my error I was getting, but the estimator is still not working.

    Do you have it working on your site? What is your site address?

    It's just like it's ignoring the onkeyup...

    I am baffled at the moment.

  4. #4
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    Quote Originally Posted by cc9537 View Post
    Thanks for your reply. That took care of my error I was getting, but the estimator is still not working.

    Do you have it working on your site? What is your site address?

    It's just like it's ignoring the onkeyup...

    I am baffled at the moment.
    Yes I do have it working on my site. As for URL here is a example product page. Not sure how much help that will be though.

    I don't understand what you mean about onkeyup though. That doesn't make sense. Mainly because you don't want to fire a onkeyup event while the zip code is still being entered since that would just return errors for the rate. Are you looking for some type of auto-complete for zip codes? That is something the Ajax Shipping Estimator does not do out of the box.

  5. #5
    cc9537 is offline Member
    Join Date
    May 2009
    Posts
    40

    Default

    Yours is not using AJAX. Mine does not have a submit button. It uses JavaScript tied to the OnKeyUp event in the zip code element, and the OnChange event tied to the state drop down.

    I figured out what is going on but I don't know how to fix it.

    The code is looking for HTML elements on the page to be named Quantity, VariantID, etc.

    C#/VB.NET Code:
    if(document.getElementById('Quantity') == undefined || document.getElementById('VariantID') == undefined)
    {
    return;

    But the elements on the page are Quanity_(ProductID)_(VariantID) ex. Quantity_103_102. and VariantID_155_155. Etc.

    C#/VB.NET Code:
    <input type="text" maxlength="4" size="3" id="Quantity_159_159" name="Quantity_159_159" value="1">
    <
    input type="hidden" name="VariantID_159_159" id="VariantID_159_159" value="159"
    If I knew how to get the current ProductID and VariantID in the Javascript, it might work.

  6. #6
    mmcgeachy is offline Senior Member
    Join Date
    Sep 2008
    Posts
    174

    Default

    ...You seem to be mistaken on what ajax is. Just because an interface uses a button doesn't mean that something that isn't ajax. Using a button was a usability call on our part. Showing an error message when there isn't full zip code didn't give the user anything useful and made unneeded requests.

    As to how to get things working there are two options that can be done. One option would be to edit the AjaxShippingEstimator in the extension base to have something like this return for the the zip code text box:
    C#/VB.NET Code:
    tmpS.Append("<input class=\"AjaxShippingZip\" type=\"text\" size=\"5\" maxlength=\"6\" id=\"PostalCode\" name=\"PostalCode\" onkeyup=\"javascript:getShipping(" sProductID "," sVariantID ");\"/>"); 
    The second option would be to replace AjaxShippingEstimator with a xmlpackage. Making sure to have onchange to pass the ProductID and VariantID.

    Both would require editing the java-script to have arguments for the ProductID and VariantID.