Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brendan Rice 537 posts 1098 karma points
    Mar 27, 2017 @ 12:28
    Brendan Rice
    0

    Custom Shipping Provider

    Our current project has the requirement to let users pick up items in store. An order can have items that can be collected and items that can be shipped. The customer has a choice in checkout whether they want to collect (only items that can be collected) and ship other items or ship all items.

    I have been researching the best way of doing this and from what I can see extending the FixedRateShipping Provider that comes with FastTrack. Here is what I have ended up with:

    Custom Fixed Rate Shipping Provider files

    My new shipping provider shows up fine in the Gateway Providers page:

    Gateway providers page showing shipping provider

    The problem I have is:

    1. The /checkout/ship-rate-quote/ shipping method dropdown doesn't populate (the Model.ShippingQuotes collection is empty).

    Here is a screencast - https://www.screencast.com/t/5SJL5QHvX2

    Can anyone help please?

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 27, 2017 @ 12:32
    Simon Dingley
    1

    Have you configured the Shipping Countries in the Shipping Providers & Methods tab of Gateway Providers?

    Check the browser console for script errors also which will help lead you toward the source of the problem.

    Simon

  • Brendan Rice 537 posts 1098 karma points
    Mar 27, 2017 @ 21:23
    Brendan Rice
    0

    I think I have narrowed it down to this call:

    IEnumerable<ShippingGatewayProviderBase> providers = MerchelloContext.Current.Gateways.Shipping.GetGatewayProvidersByShipCountry(shipCountry);
    

    This returns an empty collection so it must find any shipping gateway providers for the country?

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 28, 2017 @ 12:04
    Simon Dingley
    1

    To answer what I think you are asking - yes, it does return Gateway providers configured for the selected country.

  • Brendan Rice 537 posts 1098 karma points
    Mar 27, 2017 @ 13:44
    Brendan Rice
    0

    Cheers for the quick reply Simon.

    I had originally removed all Shipping Countries then added just UK. This seemed to work fine. But after your suggestion I tried to add "Everywhere Else" and got the following error:

    GET http://localhost:56848/umbraco/backoffice/Merchello/ShippingGatewayApi/GetAllShipGatewayProviders 500 (Internal Server Error)
    

    Exception Details: https://pastebin.com/BvbpamuX

    Any ideas?

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 28, 2017 @ 12:09
    Simon Dingley
    1

    Hi Brendan,

    Can you step through the code in your provider using the Visual Studio debugger as the error is occurring in your provider and not Merchello as such. Look specifically at the method ToShipGatewayProviderDisplay and I think that should help you locate the source of the exception.

    Cheers, Simon

Please Sign in or register to post replies

Write your reply to:

Draft