Shipping by weight not showing in cart page totals

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

I have a small problem with the Shipping by weight plugin.
It is installed , active and works fine but it does not show the shipping price when viewing the cart.

It says I need to chose the shipping method even though I only have one.

If I go throo the steps in the final order page it shows the correct shipping price acording to weight.

Is there any way to make it show the price on the cart page?


Thank you
7 years ago
It would require customization of the SHipping By Weight plugin, because it does not fully implement the GetFixedRate method:

        /// <summary>
        /// Gets fixed shipping rate (if shipping rate computation method allows it and the rate can be calculated before checkout).
        /// </summary>
        /// <param name="getShippingOptionRequest">A request for getting shipping options</param>
        /// <returns>Fixed shipping rate; or null in case there's no fixed shipping rate</returns>
        public decimal? GetFixedRate(GetShippingOptionRequest getShippingOptionRequest)
        {
            return null;
        }

Note, that the reason is probably that the configuration records can reference Country/State/Zip, and the address would not be known until selected during checkout.   If you're always using "*" (wildcard) for the address fields in the config, then it would be safe to do the customization.  (Or, I suppose you could lookup one of the customer's addresses and assume they will use same Country/State/Zip, although a Guest would not have any addresses.)
7 years ago
Thank you for your quick response but can you be a bit more specific:

Where do I make this customization?

I don`t use Fixed shipping rate , just Shipping by weight.
7 years ago
As indicated in the code comments, GetFixedRate() is a method (all) shipping provider plugins that allows such plugin to return a "rate can be calculated before checkout".   You (or some developer) can modify the code to return a rate there.
7 years ago
Where do I make this customization? What file?
7 years ago
\Plugins\Nop.Plugin.Shipping.ByWeight\ByWeightShippingComputationMethod.cs
7 years ago
public decimal? GetFixedRate(GetShippingOptionRequest getShippingOptionRequest)

This line gives this error:

Severity  Code  Description  Project  File  Line  Suppression State
Error  CS0116  A namespace cannot directly contain members such as fields or methods  Nop.Plugin.Shipping.ByWeight  C:\Users\mk\Desktop\nopsursa\Plugins\Nop.Plugin.Shipping.ByWeight\ByWeightShippingComputationMethod.cs  305  Active
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.