This topic contains 4 replies, has 0 voices, and was last updated by Olivier Gagnon NC 5 years, 10 months ago.

  • Author
    Posts
  • #21955 Score: 0

    Mohandas
    • Contributions: 0
    • Level 1
  • #21956 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    Can you narrow down the problem a bit more than "it's not working properly"?


    Mohandas replied on 05/29/2018, 10:34 AM: Hello Olivier,

    Thank you for responding.

    The problem we are facing that when we try to create Sales order with shipping details. When we select ground shipping method and hit calculate shipping button it should not send XML request to get the rates from UPS and it should set the shipping cost as “0”. When we select the shipping method as three day select it should get the rates for “Ground shipping” cost. This was our intention to create the script and it was ran successfully till last Thursday.

    But,now we are not getting the expected rates and it is sending the XML request to UPS for Ground Shipping Method as well which is not desired.

    Thank you.

  • #21957 Score: 0

    JohnCCole
    • Contributions: 0
    • Level 1

    Mohandas how is the calculateShippingButton created do you know for sure it's actually hitting the getUPSRate function.

    In your field change I assume with this line you are trying to call getUPSRate but why not just call the method. What you're actually doing is setting the onlick attributing not simulating a click.

    Code:
    $('#calculateShippingButton').attr('onclick', 'getUPSRate(); return false;');

    // why not just call
    getUPSRate();
    Is the calculateShppingButton a submit button or a normal button in the pageInit if you're trying to attach a click handler would using .click() not be better

    Code:
    $("#calculateShippingButton").click(function(){alert('Clicked now calling getUPSRate');getUPSRate();});

  • #21958 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    In general, though, DOM manipulations are not coding Best Practices and are at high risk of failing sooner or later. Your button code should be switched to respect best practices.

  • #21959 Score: 0

    Olivier Gagnon NC
    • Contributions: 0
    • Level 1

    The problem we are facing that when we try to create Sales order with shipping details. When we select ground shipping method and hit calculate shipping button it should not send XML request to get the rates from UPS and it should set the shipping cost as "0". When we select the shipping method as three day select it should get the rates for "Ground shipping" cost. This was our intention to create the script and it was ran successfully till last Thursday.

    But,now we are not getting the expected rates and it is sending the XML request to UPS for Ground Shipping Method as well which is not desired.

    Thank you.

    I'm not sure I follow. If that is what you're trying to do, why don't you just configure your Shipping Items to behave that way?

You must be logged in to reply to this topic.