The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Ajax complete call - on Shipping methods is not working with version 1.1

AnitaAnita Member
in Bugs & Feature Requests edited November 2013
We are currently adding new shipping options for a Canadian store(0.72 version.) This is the following script which was included in foxycart forum/Snippets.

jQuery(".fc_shipping_methods_inner").ajaxComplete(function (event, request, settings) {
// Do all logic here. updateShippingOptionCost, addShippingOption etc..
Multiship version
jQuery("#fc_shipto_" + j + "_shipping_methods_inner").ajaxComplete(function () {
// Do logic here - updateShippingOptionCost, addShippingOption etc..

This works great on 0.72 and lower but not on 1.1 version store. Not sure if it's something I am doing wrong.
We have multiple stores set up on our site and would prefer to have same script for all. Is there a way we can make it work ?
  • Sorry, I think I might have done it wrong...found the bug...
    Sorry guys..
  • winstonwinston FoxyCart Team
    Glad to hear you figured it out @Anita! Let us know if you have further questions.

  • Oops...Sorry I got stuck again...
    Using the ajax complete call I am trying to find the ID of the html tag that is being executed at that instance..
    For example:

    jQuery(document).ajaxComplete(function(event, xhr, settings) {
    if (settings.url.indexOf('GetShippingCost') != -1) {
    // To get the ID of the html tag of shipping option
    // Since I am using Multiship option, I'll be having #fc_shipto_0_shipping_methods_inner, #fc_shipto_1_shipping_methods_inner, #fc_shipto_2_shipping_methods_inner....and so on..depending upon the FC.checkout.config.multishipDetails.length

    Is there a way I can get the current number of ID whether it's 0, 1 , 2 or n
  • fc_adamfc_adam FoxyCart Team

    I've tackled this before, and from memory there isn't a way to find out what multiship block is being updated from within the ajaxcomplete function - what I've done in the past is update the snippets to override the updateTax function to capture what multiship it's updating.

    Are you using the multiple flat rates snippet? If so, I can share that code I have with you.
  • AnitaAnita Member
    edited November 2013
    Please do...Yes I am using multiple falt rates snippet. Also, I am adding additional functionality such as Phone field to each block after the ajax call, adding additional message to see if address entered is P O Box...and some other..

    But please do share the code..I might be able to get an idea.

    Thanks Adam!
  • fc_adamfc_adam FoxyCart Team

    Give this a look-over, hopefully that gives you an idea of how to tackle it:
Sign In or Register to comment.