How to restrict shipping to ground for product with Shipping Director 1.29

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello,

I recently installed Shipping Director v1.29 and am having some trouble with getting it to work correctly. My goal is to restrict shipping for certain items to ground if there is a certain type of product in the shopping cart. I'm hoping that this can be done either by part SKUs or categories. Below is what I have atm.

Boolean
HasPart
Items.Any(Product.Sku.Contains("MySku"))

Option
FedEx Ground
[HasPart]
Shipping.FedEx

[$Name].Contains("Ground") ? [$Name] : ""

Option
UPS Ground
[HasPart]
Shipping.UPS

[$Name].Contains("Ground") ? [$Name] : ""

Each time I run "Test", it says "Shipping options could not be loaded."

Also, the shipping methods aren't displaying to the user in the checkout process. I don't know if it has to do with using the free trial version of SD, or what it is. All I know is that it hasn't shown up yet.

I would greatly appreciate any help anybody has to offer!

Thanks!
6 years ago
Your 1st expression  ' [$Name].Contains("Ground") ? [$Name] : "" '  should just be ' true '   (no quotes ;)
The 1st "Expression" field is a "condition" expression (and determines whether the entire Option is used).  You only want your expression in the "Name Expression" field which determines if a particular method of the external shipping provider is shown to customer.
6 years ago
Thanks for your reply, New York.

Maybe I misunderstood what the difference between 'Expression' and 'Name Expression' were. I changed both Name Expressions to 'true' (minus quotes) for my Options, however it is still failing.

This is what I currently have. The space between the Rate Expression and Name Expressions is where the Surcharge Expression would be, which I don't have/need.

Boolean
HasPart
Items.Any(Product.Sku.Contains("MySku"))

Option
Fedex Ground
[HasPart]
Shipping.Fedex

true

Option
UPS Ground
[HasPart]
Shipping.UPS

true

And after setting the $Debug boolean to True, there are 2 entries in the system log that display the following:

Entry #1:

Boolean [$Debug] = True

Boolean [HasPart] = True

Option [Fedex Ground] = True
Shipping.Fedex
  Option: FedEx Priority Overnight 23.70  
  Option: FedEx 2Day 19.96  
  Option: FedEx Express Saver 18.89  
  Option: FedEx Ground Home Delivery 12.54  
Process
Add Option [True] = 23.70
  Option: True 23.70  
Update Option [True] +19.96 = 43.66
  Option: True 19.96  
Update Option [True] +18.89 = 62.55
  Option: True 18.89  
Update Option [True] +12.54 = 75.09
  Option: True 12.54  

Option [UPS Ground] = True
Shipping.UPS
  Option: UPS Ground 13.47  
  Option: UPS 3 Day Select 23.03  
  Option: UPS 2nd Day Air 28.20  
  Option: UPS Next Day Air 45.87  
Process
Update Option [True] +13.47 = 88.56
  Option: True 13.47  
Update Option [True] +23.03 = 111.59
  Option: True 23.03  
Update Option [True] +28.20 = 139.79
  Option: True 28.20  
Update Option [True] +45.87 = 185.66
  Option: True 45.87  

Entry #2:

Boolean [$Debug] = True

Boolean [HasPart] = False

Option [Fedex Ground] = False

Option [UPS Ground] = False
6 years ago
I forgot to mention that there are 2 items in the shopping cart. After removing an item (not the one I'm looking for in the expression), I receive the following entry in the system log:

Boolean [$Debug] = True

Boolean [HasPart] = True

Option [Fedex Ground] = True
Shipping.Fedex
  Option: FedEx Priority Overnight 23.70  
  Option: FedEx 2Day 19.96  
  Option: FedEx Express Saver 18.89  
  Option: FedEx Ground Home Delivery 12.54  
Process
Add Option [True] = 23.70
  Option: True 23.70  
Update Option [True] +19.96 = 43.66
  Option: True 19.96  
Update Option [True] +18.89 = 62.55
  Option: True 18.89  
Update Option [True] +12.54 = 75.09
  Option: True 12.54  

Option [UPS Ground] = True
Shipping.UPS
  Option: UPS Ground 13.47  
  Option: UPS 3 Day Select 23.03  
  Option: UPS 2nd Day Air 28.20  
  Option: UPS Next Day Air 45.87  
Process
Update Option [True] +13.47 = 88.56
  Option: True 13.47  
Update Option [True] +23.03 = 111.59
  Option: True 23.03  
Update Option [True] +28.20 = 139.79
  Option: True 28.20  
Update Option [True] +45.87 = 185.66
  Option: True 45.87  

Why is each option evaluating to True after removing an item?
6 years ago
I think I may have solved it..

It turns out that for a reason I don't know, I had two users with the same username/email in the database. Because of that, I believe that SD was running twice, returning True for one user, and False for the other and simultaneously giving me a headache.

After removing one of the users from the database and running the Test again, my shipping options are showing up nicely on the page.
6 years ago
OK.  If you have any other issues, Export your configuration and email us at support at noptools.com
6 years ago
I will remember to do that. Thank you again for your help. :)
6 years ago
Also, keep in mind that Expression (condition) should evaluate to a Boolean.  The Name Expression should evaluate to a String (method name that the customer sees, or "" empty string to suppress that method).  So, Name Expression should not be 'true'.  Leave it blank if you don't need it.
6 years ago
Thanks, I will also keep that in mind.

I'm not sure why nopCommerce is so limited when it comes to this, but SD has proven itself to be a reliable tool to achieve the functionality that I need for my website. If I run into any issues in the future, I will be sure to let support know. Thanks again!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.