in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Single shipping charge - regardless of the number or products?

Last post 06-22-2008 8:52 PM by albert@cbacomputing.co.nz. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 06-19-2008 3:02 AM

    • jmuker
    • Top 100 Contributor
    • Joined on 04-17-2008
    • Posts 9

    Single shipping charge - regardless of the number or products?

    Hi,

     

    Is it possible to charge a single predefined amount for shipping instead of a per product charge? 

     

    Filed under:
  • 06-19-2008 6:55 AM In reply to

    Re: Single shipping charge - regardless of the number or products?

    Single amount per product or single amount per order?

    If it's per order you could just use the Handling charge in the general shipping settings.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
  • 06-19-2008 11:04 AM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Single shipping charge - regardless of the number or products?

    Chris, if it is a single amount per order, and you use the method you describe, how do you configure the Simple Shipping Provider (I tried using a 0 amount)?

    --
    Bruce
  • 06-19-2008 1:37 PM In reply to

    Re: Single shipping charge - regardless of the number or products?

    The Handling Charge (actually it's called the Shipping Buffer) gets added on to any shipping charge that is returned from the GetShippingOptions method - you can see the calling method here, which is in ShippingService.cs:

    public ShippingOptionCollection GetShippingOptions(Order order)

    Now, to be fair - I haven't tried this, but the intent was there when I built it to behave like this, so there might be a bug in there preventing it. I'll add it on to my TTD list - to check it out. But, if you can set a break point and walk it through you might save yourself some waiting.

    You might also try putting a 1 in there MrBruce 1 * weight of product + ShippingBuffer is what the formula shakes out to be. So, if you wanted to do a flat rate of $10, you could have the product weight set at 1, then have the shipping rate set at 1, which will give you a $1 charge, and then add a $9 shipping buffer so you can get it to an even $10.

    Hope this helps.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
    Filed under:
  • 06-19-2008 2:00 PM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Single shipping charge - regardless of the number or products?

    admin:
    You might also try putting a 1 in there MrBruce 1 * weight of product + ShippingBuffer is what the formula shakes out to be. So, if you wanted to do a flat rate of $10, you could have the product weight set at 1, then have the shipping rate set at 1, which will give you a $1 charge, and then add a $9 shipping buffer so you can get it to an even $10.

     

    Ummm.... that won't work with a per Order fee - only a per item fee! I'm going t try leaving the product weight at zero and see if that works!

     

    --
    Bruce
  • 06-19-2008 2:14 PM In reply to

    Re: Single shipping charge - regardless of the number or products?

    Doh! Yeah, or an order with 1 item Wink.

    So, maybe it won't work quite as hoped. Geeked.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
    Filed under:
  • 06-19-2008 2:58 PM In reply to

    • MrBruce
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Juno Beach, FL
    • Posts 120

    Re: Single shipping charge - regardless of the number or products?

    While I was poking around, I noticed some unexpected behavior on the Country drop down list... when you select United States, it blows the previously selected State back to Alabama.....

    Meanwhile, when the checkout process goes to the Shipping Method tab, there's nothing there except a Continue button, which when pressed, causes an error. The error detail points here:

    System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Web.checkout.btnShippingMethod_Click(Object sender, EventArgs e) in C:\Users\Bruce\Documents\Visual Studio 2008\WebSites\AquaticsToGo\Web\checkout.aspx.cs:line 435

    And the code it is pointing to is here:

    if (!string.IsNullOrEmpty(shippingAddress.AddressId))
    {
    //They are editing an existing address
    Guid selectedAddress = new Guid(shippingAddress.AddressId);
    address =
    WebProfile.Current.AddressCollection.Find(delegate(Address addressToFind)
    {
    return addressToFind.AddressId == selectedAddress && addressToFind.AddressType == AddressType.ShippingAddress;
    });
    if (address.AddressId != Guid.Empty)
    {                                                                   //THIS IS LINE 435!!!
    //go ahead and remove it - we are just going to add it with the updated info
    WebProfile.Current.AddressCollection.Remove(address);
    }
    }

    Any ideas?

    --
    Bruce
  • 06-19-2008 8:43 PM In reply to

    • jmuker
    • Top 100 Contributor
    • Joined on 04-17-2008
    • Posts 9

    Re: Single shipping charge - regardless of the number or products?

    yes, it was meant a single shipping charge per order.

    Ok, i'm going to try leaving the weight as 0 and try to see if it adds the handling charge.

    I also wanted to see if it is possible to set the handling charge conditionally (if a particular Product Type is included in the order - charge the handling fee or else no handling fee? ('Tangible goods' get charged the handling fee but products of type 'Service' do not ?)

  • 06-19-2008 8:50 PM In reply to

    • jmuker
    • Top 100 Contributor
    • Joined on 04-17-2008
    • Posts 9

    Re: Single shipping charge - regardless of the number or products?


  • 06-20-2008 12:02 AM In reply to

    • jmuker
    • Top 100 Contributor
    • Joined on 04-17-2008
    • Posts 9

    Re: Single shipping charge - regardless of the number or products?

    I've made some changes to accomodate the handling fee by productType

    1. Added a bool field in  ProductType Table - ChargeHandling

    2.Changed the ProductType.cs to inclide this new field.

    3. Changed the  GetShippingOptions() function in ShippingService to look for the productType of the Product before charging the handling amount.

    public ShippingOptionCollection GetShippingOptions(Order order) {

            //Check to see if the handling fee is to be charged for any product in the Cart !
            //handling fee charge (Y/N) is defined in the productType table for the product.
            bool chargeHandling = false;

            OrderItemCollection orderItemCollection = order.OrderItemCollection;
            if (orderItemCollection.Count > 0)
            {
                for (int i = 0; i < orderItemCollection.Count; i++)
                {
                    Product p = Product.FetchByID(orderItemCollectionIdea.ProductId);
                    ProductType pt = p.ProductType;
                    if (pt.ChargeHandling)
                    {
                        chargeHandling = true;
                    }
                }
            }

          ShippingOptionCollection shippingOptionCollection = new ShippingOptionCollection();
          ShippingOptionCollection serviceOptionCollection;
          foreach(IShippingProvider shippingProvider in _shippingProviderCollection) {
            serviceOptionCollection = shippingProvider.GetShippingOptions(order);
            if(this.ShippingServiceSettings.ShippingBuffer > 0) {
              foreach(ShippingOption shippingOption in serviceOptionCollection) {
                  if (chargeHandling)
                  {
                      shippingOption.Rate = shippingOption.Rate + this.ShippingServiceSettings.ShippingBuffer;
                  }
                  else
                  {
                      shippingOption.Rate = shippingOption.Rate;
                  }

              }
            }
            shippingOptionCollection.Add(serviceOptionCollection);
          }
          return shippingOptionCollection;
        }

     

    Works beautifully! 

    btw - how do you paste the code in here and keep all the color coding? 

  • 06-22-2008 8:52 PM In reply to

    Re: Single shipping charge - regardless of the number or products?

    Hi there, I am having a bit of difficulties of setting a flat tax rate on DashCommerce. All the products in my store are of service type, so I have no shipping settings at all... I dont need them... Then I have set up to use "RegionCodeTaxProvider"..... havent set up any region code.... the only thing I set is the default flat rate to 0.125. That's all I have done, nothing else.... But it turns out that when I adding product to cart, and proceeding to checkout.. The "Tax" portion is always 0... Can anyone help please ?
Page 1 of 1 (11 items)