Canada Post plugin - too many shipping options displayed

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 年 前
For shipping to US from Canada, the shopping cart shows several shipping options that is quite confusing. Is there a way to narrow it down to 1-2 options that I prefer to use with CP?

v3.9
7 年 前
You'd have to customize the Canada Post plugin, or Shipping Director can do it.  See this blog example.

The Name Expression uses the ternary if-then-else operator " ? : " ).  When an external shipping plugin (e.g. “Shipping.CanadaPost”) is in the Rate Expression field, the Name Expression checks each method from the carrier, and if the expression evaluates to blank ("") the method is suppressed.

Your config would just be a one-liner:

10
Option
Shipping
true
Shipping.CanadaPost
Country = "US" and [$Name].Contains("XYZ") ? "" : [$Name]

Or if you have many method names to suppress, use OR between each, but be sure to enclose in parenthesis:

Country = "US" and ( [$Name].Contains("XYZ") OR [$Name].Contains("ABC") ) ? "" : [$Name]
7 年 前
Thank you. So, I am going to try and configure without the Shipping Director plug-in. I've never done this type of configuration before. Can you please provide a link or take me exactly through the steps? Not even sure which file to add this code to. Thanks so much in advance!
7 年 前
Hey New York,

I also am having the same problem. Where exactly would those configurations need to be placed? I'm not noticing any files that would allow to be modified in such a way...
7 年 前
In file \Plugins\Nop.Plugin.Shipping.CanadaPost\CanadaPostComputationMethod.cs, you can customize, this method

        public GetShippingOptionResponse GetShippingOptions(GetShippingOptionRequest getShippingOptionRequest)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.