Custom Shipping Endpoint

Hi,

I've finally got round to looking at the custom shipping endpoint and haven't been successful in getting it working immediately.

This what I have done:-

- Set my default category to "Shipped using live shipping rates" and set a default weight as per the instructions.
- Shipping Methods: Disabled "use custom" and enabled "use custom endpoint" and set a url of: http://www.mydomain.com/foxy/ShippingRates.php.
- ShippingRates.php contains the example code from here
- In the same folder as above I have created the ShippingResponse.php using the code provided on github
- Reset my cart include template back to responsive to remove customisation's.

Is there anything else I am missing that is obvious?

Cheers,
Simon
Comments
  • I've just checked my clients server and it is only running PHP 5.2.17 which is obviously not the minimum requirement of 5.3!

    I'll have to get that sorted out before I can continue with the custom endpoint shipping config.
  • fc_adamfc_adam FoxyCart Team
    @Simon,

    That'd do it! Glad you were able to find the problem there, we'd definitely recommend getting onto a newer version of PHP on the server if you're able - that's quite an old version now and has not been officially supported since 2011.
  • SimonSimon Member
    edited September 2016
    @fc_adam,

    I have my endpoint on a server running PHP 5.6 so the shipping calculations are working as expected.

    One thing I am having trouble with is using the error() function to display a message to the customer. It doesn't only display my error message, it also displays further error text like this:-
    Sorry, we can't ship to this location Error: This store has not been setup correctly to calculate shipping to this location with this weight. We apologize for the inconvenience. The store owner has been notified of this error.
    The code I am using is:-
    $rates->reset();
    $rates->error("Sorry, we can't ship to this location");


    Cheers
    Simon

  • fc_adamfc_adam FoxyCart Team
    edited September 2016
    @Simon,

    Awesome! Glad to hear you got it working for your rates! That additional text is the standard shipping error text that gets displayed along with shipping errors, or also in the case that no shipping rates were returned, and no errors either. If you want to alter that text, you can edit it from the "language" section of your store's FoxyCart administration.
  • Aha! It was in the checkout section and not the cart where I was looking. Thanks for making me search properly!

Sign In or Register to comment.