Custom Shipping Rate NullRef Creating Instance with Activator

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Hi Guys I'm getting a Null Reference Exception when trying to access the cart with a new shipping method..

my class name is: NopSolutions.NopCommerce.Shipping.Methods.ShippingByCountryCM.ShippingByCountryComputationMethod, Nop.Shipping.ShippingByCountry


and it's blowing up on the line:

var iShippingRateComputationMethod = Activator.CreateInstance(Type.GetType(shippingRateComputationMethod.ClassName)) as IShippingRateComputationMethod;

Type.GetType is returning null..

my computation method class looks like so:

namespace NopSolutions.NopCommerce.Shipping.Methods.ShippingByCountryCM
{
    /// <summary>
    /// Shipping by country computation method
    /// </summary>
    public class ShippingByCountryComputationMethod : IShippingRateComputationMethod
    {      



my assembly name for the class library containing the computation class is: Nop.Shipping.ShippingByCountry




I would love to know what im doing wrong!!! as the admin section is working fine!
13 лет назад
** BANGS HEAD AGAINST DESK **

Hahaha forgot to add a reference to the Store Project...


Well anyway! I've made a shipping module that is "Fixed Price by Country" and divided the countries up into Zones and Populated the DB with fixed price shipping for every country based on:

Australia - (Country of Store's Origin) - Regular Post, Express Post

Rest of the World - Airmail from Australia, Registered Airmail From Australia


and worked out reasonable fixed prices for certain areas of the world and done group insert intos to get the 'zoned' result.. but leaving it so that you can manually update any price per country if i've got the 'zoning' incorrect.

If anyone wants a copy let me know!


Also! just a quick question!!

With the free shpping over X is it possble to get the cart to say FREE and restrict the shipping method to an option ie FREE shipping?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.