Shipping Provider Issues - Urgent

May 16, 2013 at 8:29 AM
Hi,

We have been using a custom shipping provider for several months without issues, but for some reason it has just stopped working, and is returning a zero shipping cost. As this is a live site, the client is upset :-(

I am hoping it is as simple as a setting being inadvertently changed.

Can someone assist me in checking through which of these settings needs to be updated for the provider to work, or give me anything else to check?

Perhaps i should re-upload the DLL, but as there are no errors in the DNN event log I expect this is a configuration issue.

My Current Settings are below:

StoreBackOffice/ Shipping/ Method

Name Description Display Template URL Tracker Template
Standard Standard standard.shiptemplate courierpost.tracktemplate

StoreBackOffice/ Utilities/ Payment/ Shipping

calcship.provider: Setting Value: CustomShippingProvider,NEvoWeb.Modules.NB_Store......CustomShippingProvider.StarTrackShip
country.list: Setting Value: Australia,New Zealand
ordershipdate.days: Setting Value: 0
shipcountrycode.default: Setting Value: <BLANK>
shipfree.list: Setting Value: <BLANK>
shippingcumlative.flag: Setting Value: NO

Thanks in advance.

regards
TheTimp
Coordinator
May 16, 2013 at 10:12 AM
Hi,

OK the first thing to check is the setting "calcship.provider" this should hold the dll and namespace of your bespoke shipping provider. If it's there then check you have the dll in the DNN bin folder. (There is very little documentation on this, I even had to look at the code to find the setting name!....so try and contact the person who wrote your bespoke provider)

My next though on this is that if you've not changed anything in NB_Store, then it's going to be the interface on the shipping provider side that has changed....which does seem a crazy thing for them to do??....have you asked them if any update on their system has been done?

It could also be a connection issue to their server, either from your server blocking it or their server being down or something?

AFAIK - nothing on the NB_Store side of code has change for the shipping interface, so it should continue to work!

Regards,
Dave.
May 17, 2013 at 5:05 AM
Thanks leedavi,

Have verified that this reference:
calcship.provider: Setting Value: CustomShippingProvider,NEvoWeb.Modules.NB_Store......CustomShippingProvider.StarTrackShip
Matches the DLL in the DotNetNuke Bin Directory.

Have checked the NEvoweb.DNN.Modules.NB_Store.DLL version installed is 2.3.2.34 which matches the DLL used to build the Custom Shipping Provider..

Can you confirm the Store settings are correct - and if there are any others to look at?

Have checked with the shipping provider, and they say all is working from their end :-(

Will build a test rig, to test the comms and see what is going on in the meantime..

regards
TheTimp
Coordinator
May 17, 2013 at 6:13 PM
Hi,

Yep, I'm at a bit of a loss to help here, because I don;t know what your bespoke shipping provider is doing. A couple of things you could try is to set some kind of shipping in the standard NB_store shipping calculation and see if it's working...if it is then maybe you provider is not being called at all, which could be a caching issue, but I would expect a restart of the app to solve that.

Another idea, if you have the original source code of your bespoke provider is to add some debug statement which fire off a msg to the DNN log and hence try and trace the action that way.

After you've setup test rig, if you let me have access I could have a look, but to be honest without knowing what you bespkoe provider is doing, I may not be much help.

As a temporary fix you could activate the NB_store shipping with some kind of close matching shipping price, so you client doesn't lose money. But I suppose this depend on how complicated you clients shipping calcs are!

Regards,
Dave.
May 27, 2013 at 11:08 AM
Hi Dave,

Still going with this as my approach from outside of DNN didn't pan out, it looks like the CalcShipInterface, has a private provider which will only instantiate from within DNN, as it requires details from the portal settings..

So am now knocking up a DNN module to communicate with the existing shipping provider.
Hoping just be able to call getCartTotals, on the existing module code, so i can inspect the existing code with minimal disturbance.

Any tips on construction are appreciated :-)

regards
TheTimp
Coordinator
May 28, 2013 at 8:42 AM
Hi,
I can't remember the interface code for shipping off the top of my head, but I'm not surprised if it links to the DNN portal data, NB_Store is designed to run in multiple portals, so it's probably using this info to get the correct order/cart/shipping data.

Dave.
Coordinator
May 28, 2013 at 8:44 AM
um!!......thinking again...that does seem a little odd for an interface....I'll look !!!
Coordinator
May 28, 2013 at 8:53 AM
OK...it's using the current instance of the portalsettings to get the portalid so the provider can be created by name from the Nb_Store setting. But you should only need a reference to the DNN and NB_Store dll's.

I'm not sure what your trying to do? Maybe something different to my thoughts, but have you downloaded the shipping provder example..

https://nbstore.codeplex.com/releases/view/34143

Regards,
Dave.
May 29, 2013 at 9:12 AM
Hi Dave,

Thanks for your assistance...I feel i am making progress here..

I created a new DNN Module, and added the classes used in the custom shipping provider to the project, so i could pass in the PortalID and Cart ID to the getCartTotals method ( in the Custom Shipping Provider Classes) as per below, and step through the code playing with values to see what was happening (code included in next post to keep this one clean)

That worked fine, and the code calculates the shipping on the development server correctly, so now i need to find out why the production server is not returning a value..

Is there any Doco on the settings that are required for the Custom Shipping Provider?

regards
TheTimp.
May 29, 2013 at 9:13 AM

Test Rig Code

    protected void StartTestRig_Click(object sender, EventArgs e)
    {
        NEvoWeb.Modules.NB_Store.XXXXXCustomShippingProvider.StarTrackShip oStarTrackShip = new NEvoWeb.Modules.NB_Store.XXXXXCustomShippingProvider.StarTrackShip();

        int PortalID = DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings().PortalId;
        string CartID = "f8fb2616-bb4f-47e9-8496-5eea5fbe8951"; //from [NB_Store_Cart] Matches Order Id 1296 from [NB_Store_Orders]
        NEvoWeb.Modules.NB_Store.CartTotals objCartTotals = new NEvoWeb.Modules.NB_Store.CartTotals();

        string ShipType = string.Empty;
        string CountryCode = string.Empty;
        int ShipMethodID = 0;

        ////getCartTotals(int PortalID, string CartID, CartTotals objCartTotals, string ShipType, string CountryCode, int ShipMethodID)
        oStarTrackShip.getCartTotals(PortalID, CartID, objCartTotals, ShipType, CountryCode, ShipMethodID);

        // Get value from Cart and display it in button text
        StartTestRig.Text = "Shipping Amount$" + objCartTotals.ShipAmt.ToString();
    }
May 29, 2013 at 9:13 AM
The Downloads Page has three entries (below) about shipping, none of which tells me what settings I need to check :-(
  1. Shipping_Region_SQL_Insert_fr-FR.txt : A list of French Shipping Regions
  2. CreatingRegionsForShipping.pdf: A document that shows how to create other shipping cost for regions
  3. and the ShipcalcProviderExample.zip containing the following VB code

ShipcalcProviderExample Code

Public Class upsCalcProvider
    Inherits CalcShipInterface

    Public Overrides Function getCartTotals(ByVal PortalID As Integer, ByVal CartID As String, ByVal objCartTotals As CartTotals, ByVal ShipType As String, ByVal CountryCode As String, ByVal ShipMethodID As Integer) As CartTotals
        Dim weight As Decimal = 10.0
        objCartTotals.ShipAmt = weight
        Return objCartTotals
    End Function
End Class

.

Is there any Doco on the settings that are required for the Custom Shipping Provider?
May 29, 2013 at 9:16 AM
I am hoping for a bit more detail on what settings need to be included in what sections, as the links that have been mentioned (below) detail are more about using locations rather than utilsing a custom provider.

https://nbstore.codeplex.com/wikipage?title=Shipping&referringTitle=Documentation
https://nbstore.codeplex.com/discussions/227950
http://<your site>/DesktopModules/NB_Store/documentation/Documentation.html#Div4

I am looking for detail like:

Utilities/ Payment/Shipping:

  1. The calcship.provider: Setting Value should be from your DLL in the directory [Drive Letter]:\DotNetNuke\bin in the format:
    [module name],NEvoWeb.Modules.NB_Store......CustomShippingProvider.[Class Name of Overidden CalcShipInterface Class]
  2. The calcship.provider when configured here will overwrite built-in NB_Store shipping calculations.
  3. [insert detail about the relationship between the calcship.provider and Method, By Weight, By Price, By Quantity, By Country, By Product, free limit]
    i.e are formulas inserted here applied before or after the calcship.provider (or not at all) ??
  4. See detail about Track and Ship Templates in the Help Section on the Admin Page
I am hesitant to play with the settings, as i am trying to locate the reason it has just stopped working, so if it happens again we know what to look for...

sorry for the multiple posts, but the editor did not like the large post initially.

regards
TheTimp
Coordinator
May 29, 2013 at 10:07 AM
HI,

Ok that setting "calcship.provider" is the shipping provider that is overwriting the build-in shipping. If it's empty then the build-in shipping calcs will start working, if not then whatever dll that "calcship.provider" setting is pointing to will run.

Basically all you should need to do is create a dll shipping provider, following that example zip, put it in the dnn/bin folder and set that "calcship.provider" setting to look for it. It should then pickup your code for the calc instead of the built-in functionality.

The provider plugin is basically a replacement for the normal store shipping.

Regards,
Dave.
May 29, 2013 at 11:37 PM
Thanks Dave,

Looks like my settings are fine and the DLL should work....

Let me try removing the calc ship provider setting, to return the store to calculating shipping to its default options and see what happens.
If I get a result I can then replace the existing DLL with the one I have tested, and re establish the setting.

Will take the opportunity to add some diagnostic event code entries into the code...

Regards
The Timp
May 31, 2013 at 12:19 AM
That did the trick,
the Debug messages are now visible in the log viewer.

I have managed to locate the issue in the code.

Thanks for you assistance.

regards
The Timp