• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Andy Miller
#1 Posted : Tuesday, November 14, 2006 8:31:18 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
This might be too big, but I have a problem with the current RequiresXXX properties in ShipperProvider. The problem is that the answer depends on how the provider is configured. For example I can ask DHL for a rate estimate with or without the city name. With the city name the returned rate estimate will be more accurate and it will include a service level estimate (i.e. delivered by 10am). Without the city the rate estimate will be less accurate and will not have an SLA.


I'd like to give the merchant the ability to decide which rates they want.



But that means that RequiresCity will depend on how the ShippingMethod is configured.



So what I am asking is for is something like this for each of the RequiresXXX properties and GetTrackingUrl:


Code:

[color=#0000ff]
public[/color][color=#000000] [/color][color=#0000ff]abstract[/color][color=#000000] [/color][color=#0000ff]bool[/color][color=#000000] RequiresCity(string bvin) { [/color][color=#0000ff]get[/color][color=#000000>;]
[/color]

or


Code:

public[color=#000000] [/color][color=#0000ff]abstract[/color][color=#000000] [/color][color=#0000ff]bool[/color][color=#000000] RequiresCity(ShippingMethod method) { [/color][color=#0000ff]get[/color][color=#000000>;][/color]

Where bvin is the ShippingMethod ID. Most providers would simply ignore the bvin and return the same value they are now. But I would look up the configuration and return an appropriate value.



I also have some new shipping providers in the works that perform tricks like dividing the order amoung multiple shipping methods. This provider must ask each of the shipping methods involved if they require the input and then supply a combined answer. This will only work if I can ask RequiresCity(method.bvin) or RequiresCity(method).



I think the changes will not be too bad. Each of your providers would simply need to change the signature of their override and return the same value. Then the ShippingRates page and checkouts would need to use the new signature. Altogether I think it is less than 10 changes.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
jetheredge
#2 Posted : Wednesday, November 15, 2006 11:10:37 AM(UTC)
jetheredge

Rank: Member

Joined: 3/1/2006(UTC)
Posts: 1,142

It appears to me there may be an issue with this. It looks like to me you want the ShippingMethod so that you can determine the exact method of shipping (i.e. Ups Ground, Fedex Express). The shipping method does not provider this information. It is merely a shipping method defined by the admin. If you look at the UPS shipping methods, one method can encompass several provider shipping types. It is the ProviderServiceCode that actually determines the precise shipping method used by a particular provider. This is requested on the order level, but can be different at the package level.

The only thing that the ShippingMethod will tell you which you can rely on is who is shipping the package (ie UPS, Fedex, DHL, etc...) but it cannot reliably tell you how it is being shipped. Since each provider implements its own RequiresCity, RequiresState, etc... it already knows which method is being used. Let me know if you have any more questions about this, because I really do want to help, but I want to make sure that if we implement something like this that we get it right the first time.
Justin Etheredge
Senior Software Engineer
BVSoftware
Andy Miller
#3 Posted : Wednesday, November 15, 2006 12:31:26 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
Thank you for looking at this and the thought provoking questions. I don't really need access to the ShippingMethod per se (which is why I suggested just the bvin). I really just need access to the ShippingMethod-specific (aka local) ComponentSettingsManager...the one you create with "new ComponentSettingsManager(method.Bvin)".


The provider will use those settings to decide how to answer the questions "Do you require a city", etc.



There are three situations in which I will use this.



First, the EstimateShipping.aspx page currently has code like this...


Code:

provider = AvailableProviders.FindProviderById(method.ShippingProviderId)
If provider IsNot Nothing Then
If provider.RequiresCity Then
Return True
End If
End If


[/code]

The problem is that I want the merchant to decide if RequiresCity is true or false. And I want the merchant to be able to make a different decision for each instance of ShippingMethod. For example, the merchant might create two ShippingMethods that both use my DHL Provider. The first only returns Ground and the merchant has turned off Requires City. The second returns all the other rates and the merchant has turned on Requires City. If the code looked like this...

Code:

provider = AvailableProviders.FindProviderById(method.ShippingProviderId)
If provider IsNot Nothing Then
If provider.RequiresCity(method.Bvin) Then
Return True
End If
End If


...then my DHL Provider could create a ComponentSettingsManager with the method.Bvin, look up, and return the "RequiresCity" setting.


The second scenario is for a new ShippingProvider that I am working on that will divide up an order based on rules. For example one rule might be that the product "ABC" always uses the "Freight" ShippingMethod while all other products use the "DHL" ShippingMethod.



In this case, when EstimateShipping.aspx asks my new provider "Do you require city?", my provider needs to move through each possible shipping method and ask it's provider, "Do you require a city?". The list of possible shipping methods ("Freight" and "DHL" in this example) is stored in the local ComponentSettingsManager. It looks something like this:



Code:

Public Overrides Readonly Property RequiresCity(string bvin)

Dim settings As New ComponentSettingsManager(bvin)

Dim methods as Collection(Of ComponentSettingListItem) = settings.GetSettingList("Methods")

For Each method As ComponentSettingListItem in methods

Dim provider As ShippingProvider = AvailableProviders.FindProviderById(method.Setting1);

If provider.RequiresCity(method.Setting2) Then Return True

End For

Return False

End Property

So you see my provider used the method bvin to find the list of child shipping methods, then it asked the provider of each child shipping method if it requires a city passing it the bvin of the child method. If the child method was my DHL provider then it would look up the setting to see what the merchant decided.


The third situation is not solvable without a major change. So never mind about GetTrackingUrl.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012