in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Shipping?

Last post 06-05-2008 10:54 AM by MrBruce. 25 replies.
Page 1 of 2 (26 items) 1 2 Next >
Sort Posts: Previous Next
  • 05-21-2008 11:28 AM

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

    Shipping?

    My customer charges a flat rate of $24.95 for overnight shipping (FedEx) within the continental United States for any order between $70 and $199.99. Above that price, shipping is free. Below that price, the order should not be accepted.

    1. How do I configure the shipping for this use case?
    2. How do I configure dC3 to not allow an order of less than $70 to complete?

    P.S. I just found out that there will also be a number of "packages" that will include Free Shipping.

    --
    Bruce
  • 05-26-2008 9:55 PM In reply to

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

    Re: Shipping?

    Nobody has words of advice to offer?????

    --
    Bruce
  • 05-26-2008 11:17 PM In reply to

    Re: Shipping?

    1. You can create your own ShippingProvider (It shouldn't be hard)
    2. There might be a better way but a quick way to do this is edit the checkout page and the cart page to enforce this.

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 05-27-2008 9:23 AM In reply to

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

    Re: Shipping?

    Thank you for your response, yitzchok, but could you please elaborate and shed some light on HOW I might go about those two items?

    --
    Bruce
  • 05-27-2008 7:21 PM In reply to

    • Naz
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Posts 60
    • dashCommerce Core Team

    Re: Shipping?

    I guess what you could do is hack the SimpleWeightShippingProvider.cs by changing line

     shippingOption.Rate = simpleWeightShippingRate.AmountPerUnit * order.TotalWeight;

    to

            if (order.Total > 70 && order.Total < 200)
                shippingOption.Rate = (decimal)24.95;
            else
                if (order.Total >= 200)
                    shippingOption.Rate = 0;
                else
                    shippingOption.Rate = -1;

    and then in checkout.aspx.cs check if rate = -1 and display some sort of message.

    www.objectreference.net - My Blog
    www.vortexleather.com - My Leather clothing store

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 05-27-2008 9:08 PM In reply to

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

    Re: Shipping?

    Naz, Thank You very much! It looks simple enough - and I will give it a try first thing tomorrow!!!

    --
    Bruce
  • 05-27-2008 10:18 PM In reply to

    • yocuteem
    • Top 10 Contributor
    • Joined on 03-17-2008
    • Philadelphia Area
    • Posts 67

    Re: Shipping?

    You could also just use the SimpleWeightShippingProvider as an example and create your own provider.  I created a new shipping provider today in under an hour by using the SimpleWeightShippingProvider as my starting point.  One of my clients wants to have a flat "per order" shipping rate.  They sell small items so the shipping cost is very low.  They wanted the following:  $5 for USPS domestic; and $5 for USPS International.  Pretty simple.  Here's what I did:

    1. I created a new table that was similar to dashCommerce_Store_ShippingEstimate, well, it was pretty much an exact copy except the field named "AmountPerUnit" was renamed "AmountPerOrder", everything else was the same.  I named the table:  dashCommerce_Store_PerOrder_Shipping_Rate.
    2. I then used SubSonic to create my controller, collection and item classes for this new table.  This resulted in the following objects being created:  PerOrderShippingRateCollection, PerOrderShippingRate, and PerOrderShippingRateController.  The first two classes were put in Store\Models/Generated, the controller was placed in Store\Controllers\Generated.
    3. Then, I went to work on the UI.  I copied simpleweightconfiguration.ascx, and created PerOrderChargeConfiguration.ascx.  I modified the new file slightly to accomodate the new shipping provider, but there really wasn't much that needed changing.  This new file was put in:  Web\admin\controls\configuration\shippingproviders.
    4. Then, I created PerOrderShippingProvider.cs in Store\Services\ShippingService, which again was a copy of SimpleWeightShippingProvider.cs, with the code changed to use the PerOrder objects.
    5. I then created perordershippingprovider.ascx in Web\admin\controls\navigation, which was a copy of simpleweightshippingprovider.ascx.  I modified this to match the Per Order provider.
    6. And lastly, I create PerOrderShippingProvider.sitemap in Web\admin\controls\navigation.  Again, it started as a copy of: simpleweightshippingprovider.sitemap.
    7. I then added the following node into the SiteMap/Providers node in the web.config: 

      <add name="PerOrderShippingProviderXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/admin/controls/navigation/perordershippingprovider.sitemap"/>

    8. I added a record in the:  dashCommerce_Store_Provider table for the new provider.

    9. I added a new entry in the labels.resx resource file for the hdrAmountPerOrder value.  I created this for the configuration control.

    That's about all I did.  I did this earlier today, so I am relying on my memory, as well as the modified date on the files on my hard drive.  :)

    I hope this helps you.  If you want, I can upload my files to this post and you can use it as an example.  I didn't create a patch for this because I am under a tight deadline right now.  If people are interested let me know and I'll create a patch.

    Tim

    Tim
  • 05-28-2008 3:01 AM In reply to

    • Naz
    • Top 10 Contributor
    • Joined on 02-11-2008
    • Posts 60
    • dashCommerce Core Team

    Re: Shipping?

    Please do share the code i'd like to see it as i'm working on one myself.
    www.objectreference.net - My Blog
    www.vortexleather.com - My Leather clothing store

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 05-28-2008 7:27 AM In reply to

    • yocuteem
    • Top 10 Contributor
    • Joined on 03-17-2008
    • Philadelphia Area
    • Posts 67

    Re: Shipping?

    Ok, I have a zip file of all the code files, how do I "share" this with everyone?

    Tim

    Tim
  • 05-28-2008 12:29 PM In reply to

    Re: Shipping?

    Answer

    You can post it up on CodePlex

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 06-03-2008 9:53 AM In reply to

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

    Re: Shipping?

    Okay, I didn't get to this right away, but now that I have, I realize that since I downloaded the "Web Ready" package, I don't HAVE these files!!!

    SO, my question is: Can I download the full package, make these changes, rebuild the solution, and then upload changes to the BIN files? Or will that mess me all up???

    --
    Bruce
  • 06-03-2008 10:17 AM In reply to

    Re: Shipping?

    That should work just fine.

    --
    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-03-2008 1:41 PM In reply to

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

    Re: Shipping?

    Naz:

    I guess what you could do is hack the SimpleWeightShippingProvider.cs by changing line

     shippingOption.Rate = simpleWeightShippingRate.AmountPerUnit * order.TotalWeight;

    to

            if (order.Total > 70 && order.Total < 200)
                shippingOption.Rate = (decimal)24.95;
            else
                if (order.Total >= 200)
                    shippingOption.Rate = 0;
                else
                    shippingOption.Rate = -1;

    and then in checkout.aspx.cs check if rate = -1 and display some sort of message.

    Okay, I found and changed the SimpleWeightShippingProvider.cs as indicated above, and I've looked at the checkout.aspx.cs and can't figure out how/where/what to do!

    I found the area annotated as "Gets the shipping rates" and at the bottom I added:

    if (order.ShippingAmount = -1)
    {
    throw new InvalidOperationException("Minimum Order is $70.");
    }

    But I get an error when I try to build that says:

    Error 82 Cannot implicitly convert type 'decimal' to 'bool' 

    Any ideas???

    --
    Bruce
  • 06-03-2008 2:23 PM In reply to

    Re: Shipping?

    single = is an assignment of value

    double == is an equality comparison.

    --
    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-03-2008 2:44 PM In reply to

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

    Re: Shipping?

    D'oh!

    Thanks!!

    --
    Bruce
Page 1 of 2 (26 items) 1 2 Next >