Shipping rules

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hi!

One of our customers want to implement new shipping rules:

Product(s) Quantity in shopping cart         Parcel Price              Courier Price
                       1-6                                                            3,9                                  5,9
                       7-12                                                          5,9                                 10,9
                    Over 12                                                       NA                                 10,9

Anyone has idea how to solve this? At the moment, there is no plugin in the marketplace for this. I looked the ShippingDirector plugin but it looks complicated to achieve that.
2 years ago
If you are using the Fixed Or By Weight plugin, then it's possible to set the Weight of each of your products to "1", and then use the By Weight ranges.  (But if you need to have accurate weights on your products, then this won't work).

We replied to your request to nopTools.com.  Using Shipping Director can handle this easily with just two Option rules (and the first rule just to count items in cart).  It may look "complicated", but the  '  ?  :  '  is just the if-then-else operator.  For example
[Count] <= 2 ? 3.9 : [Count] <= 6 ? 3.9 : 5.9
means
if  Count <= 2 then 3.9 else if Count <= 6 then 3.9 else 5.9
Integer
Count
Items.Sum(Quantity)

Option
Parcel
[Count] <= 12  (this is the condition expression, since you indicated "NA" for Parcel when count > 12)
[Count] <= 2 ? 3.9 : [Count] <= 6 ? 3.9 : 5.9

Option
Courier
true
[Count] <= 2 ? 5.9 : [Count] <= 6 ? 5.9 :  [Count] <= 12 ? 10.9 :  10.9
2 years ago
Thanks!

These rule implementations are correct, but we would need these rules to work with our own Parcel Machine & Courier shipping methods, e.g we implemented a plugin for our countries parcel machines and customers use it in the checkout. Now we would like to use ShippingDirector and apply these rules to existing shipping methods.

Is this possible?
2 years ago
Sure.  SD (Shipping Director) can call external shipping rate plugins :)

If you don't need to call the Fixed By Weight plugin (because you only have one method there), then you can just use an Option rule where you specify the Name and Rate directly in the Rate Expression field:

Option
Courier
true
[Count] <= 2 ? 5.9 : [Count] <= 6 ? 5.9 :  [Count] <= 12 ? 10.9 :  10.9


Then, another Option rule can 'call' your shipping plugin:
Option
Parcel
[Count] <= 12
Shipping.YourPluginName
[Count] <= 2 ? 3.9 : [Count] <= 6 ? 3.9 : 5.9


RE: "Parcel"
Here you can call the Name anything you want; the actual method names the customer sees will be from your plugin.  (But SD can override the names if you want to.)

RE: "Shipping.YourPluginName"
This is in the Expression field. If SD sees the "Shipping." prefix, then it calls the shipping plugin with that System Name, and "processes" each method/rate returned (using the Surcharge, Name, and Description Expression fields on the rule).

RE: "[Count] <= 12"
The Expression field is a 'condition'.  In this case, the YourPluginName plugin will only get called when the Count <= 12

RE: [Count] <= 2 ? 3.9 : [Count] <= 6 ? 3.9 : 5.9
That's the Surcharge Expression field.  The assumption is that your plugin returns a 0 rate, and the the Surcharge Expression field will calculate the rate based on the Count (of items in cart).  (A 'Surcharge' is added to the Rate.)
1 year ago
Thanks for quick answer!

Can SD call Pickup providers as well? We have solved our parcel machines as PickupPointProvider.
1 year ago
Sorry no.  Shipping Director can only 'control' shipping providers.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.