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.

Custom end point logic issue

PhilippePhilippe Member
in Help edited June 2018

We use the custom end point (PHP) on certain of our product categories - in certain cases, the same shipping rate is presented twice - we suppose it may be because the custom end point logic is executed twice - can you help ?

To reproduce:
- go to
- click on the Euro flag, activating the European store, (if you are not located in Europe).
- take the first product and hit the button "Acheter sur le site EU"
- chose shipping to France, zipcode 31500

  • fc_adamfc_adam FoxyCart Team

    Thanks for posting the steps to reproduce. I'm guessing you're referring to the "Voiles Laser Colissimo France 2 jours -- Autres voiles dériveurs UPS INTL 4-5 jours" rate? If so - looking at the logs, that rate is being returned twice from your custom shipping endpoint, one with a rate ID of 10100 and the other with a rate ID of 10200.

    Is there any chance that's happening in your custom endpoint?
  • Further, we have noticed another issue that actually prevents us from taking orders .... The custom shipping end point does not seem to calculate any postages, for a certain product ordered from Australia with product category set to AU-DINfor although it should, and did... - to reproduce:

    From a machine in Australia:
    - access
    - verify you are set to australian store (the little flags next to the products should be Australian flags
    - order a product
    - the side cart fails to calculate any rate
    ----> (note, since there are no rates, a custom message is added in the foxy custom footer- but the issue remains that no rates are calculated)
    - this issue appeared sometimes after 5/27 - before this the custom logic has worked flawlessly. We can not identify any changes in that period, other than we upgraded our version of PHP
    - the issue does happen only with machines located in Australia / New Zealand (all those we tested on). It does not appear on machines located in the US - we have not been able to reproduce from the US using a Australian web proxy, as the side cart does not work thru proxies
    - I have captured 2 shipping payloads for attempts where no rates were calculated, and one where a rate was calculated. Can whisper those files.
  • We have resolved the Australian issue. The custom endpoint was not finding any rates for "New South Wales", and Australian state , because you changed without warning, the encoding of the region from "NSW", to "NS". I wish you would notify clients about this, as this breaks any code that looks for "NSW" to calculate a rate.

    Please proceed with haste on the original issue in the first post though.
  • fc_adamfc_adam FoxyCart Team

    Looks like we may have posted at the same time earlier, you can check the answer for your first query in my reply above.

    In terms of the issue you've noted for Australia - you are right that the code is currently being trimmed to 2 characters when we send it on to shipping endpoints, but that isn't a change that has been applied recently. It was introduced around 4 years ago in relation to issues with a couple of the shipping rate carriers erroring if the code was longer than 2 characters.

    That change was in place before we released our custom shipping endpoint - as best as I can tell, the region should have always come through as two characters within the shipment node. I could be wrong there, but from reviewing the code changes and some of your transactions from early in May, that looks to be the case.

    That said - you're right that for Australia the region code is indeed 3 characters, and we have a ticket in place to remove that trimming to ensure the codes come through as expected. I'm sorry for the confusion and inconvenience that the trimmed values have caused. Before releasing that change to remove the trimming, we'll be reaching out to all stores with the custom shipping endpoint in place to let them know that the data will be changing for any customers with a region code longer than 2 characters.
  • Adam,

    -1- on the fits issue - thanks for passing me the numbers of the rates came under - was able to find immediately the fault in the implementation of our impeccable logic... ;-)P item closed!

    -2- on the Australia stuff, we did not sell sails in NSW since March, and we have since implemented a full redesign of out site, and with it may have come an older version of our end point that did not handle NSW as expected.

    That being said, our code now expects 2 digits for every state in Australia - which methods will you use when reaching out about the 3 digit codes ? emails ?
  • brettbrett FoxyCart Team
    @Philippe We've got a pending fix in QA to not truncate states/provinces/regions (in certain situations), and we'll be emailing to all users who have access to any stores that use the custom shipping endpoint in the next few days. We'll give at least 3 weeks before we make a change, though because of how things work (with many countries continuing to be 2 characters because of how our state/province/region selection works) we don't anticipate it to be too huge an issue for anybody to handle.

    I'm glad we were able to get you what you needed :)
Sign In or Register to comment.