Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Zac 223 posts 575 karma points
    Feb 01, 2011 @ 18:39
    Zac
    0

    Question about features

    Hi Lasse, Søren, and anyone else,

    I hope you don't mind me asking a few questions about features. I get the impression everything is fairly extendable, but I'm looking for whether or not I can get a few things out of the box (and if not, how hard it is to implement on a very tight schedule!). I'm sure some of my questions are answered here on the forum but I've already spent a fair bit of company time playing with uCommerce!

    Question 1.

    Is it possible to have say:

    Product A delivery charge is €1

    Product B delivery charge is €5

    Delivery cost for product A + B together = €5

    Question 2.

    Can the system send different picking orders (not sure this is the correct terminology) to different warehouses. In other words, when someone completes an order, warehouse A needs notifying about product X, and warehouse B needs notifying about the order of product Y.

    Question 3.

    Is it possible to add a delivery surcharge based on a specific set of postcodes? I.e. for UK postcodes starting in AB41 (up in Aberdeen somewhere), delivery surchage is + €9 on top of the €5 charge for Product B

    Thanks for your time!

  • Sean Mooney 131 posts 158 karma points c-trib
    Feb 01, 2011 @ 19:27
    Sean Mooney
    0

    Hello Zac, uCommerce is very extensible in a number of ways, here are a couple of quick answers to your questions:

    1) This can be done in two parts. A custom property on every product (call it deliveryCharge) and a custom action in the pipeline (http://blog.lasseeskildsen.net/post/uCommerce-Pipelines-Explained.aspx) to calculate the shipping cost (basically loop through all items in cart and add that custom property)

    it should be very close to this http://www.publicvoid.dk/SimpleInventoryManagementWithUCommerce.aspx

    2) This could be handled in a number of ways, uCommerce offers a number of places to tie in your own custom code. I would imagine you would hook into the status change of an order (again another pipeline, http://blog.lasseeskildsen.net/post/Understanding-uCommerce-Order-Statuses.aspx)

    3) This can be done by writing your own custom shipping provider and tying it into uCommerce.

    also be sure to check out: http://blog.lasseeskildsen.net/?tag=/ucommerce

    and: http://www.publicvoid.dk/CategoryView,category,uCommerce.aspx

    Hope that helps,

    -Sean

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 02, 2011 @ 14:46
    Søren Spelling Lund
    0

    Hi Zac,

    You can also create your own shipping method service, which is what uCommerce uses to calculate shipping costs based on the selected shipping method.

    To create a new shipping method service you'll implement the IShippingMethodService interface. With that in place you register your new service with uCommerce by editing web.config:

           <ordersConfiguration>
                <shippingMethodServices>
                    <add name="SinglePriceService" type="UCommerce.Transactions.Shipping.SinglePriceShippingMethodService, UCommerce" />
                </shippingMethodServices>
            </ordersConfiguration>

    With this in place in your web.config you can now select your custom service in the uCommerce UI when you edit a shipping method:

  • Zac 223 posts 575 karma points
    Feb 03, 2011 @ 16:27
    Zac
    0

    Thanks a lot for answering those Sean, Søren, appreciate it.

    I've been having a go at creating a shipping method service. I might just be failing at Google, but I can't seem to get my head around what I need.

    I created a class:

    public class MyShippingMethodService : IShippingMethodService
    {
    #region IShippingMethodService Members

    public UCommerce.Money CalculateShippingPrice(UCommerce.Entities.Shipment shipment)
    {
    throw new NotImplementedException();
    }

    public string Name { get; set; }

    public bool ValidateForShipping(UCommerce.Entities.Shipment shipment)
    {
    throw new NotImplementedException();
    }

    #endregion
    }

    Now obviously I haven't implemented anything yet other than the Name prop. I've I stuffed that class into my App_Code, and I changed my web.config to look like:

    <shippingMethodServices>
    <add name="SinglePriceService" type="UCommerce.Transactions.Shipping.SinglePriceShippingMethodService, UCommerce" />
    <add name="MyShippingMethodService" type="MyShippingMethodService, __Code" />
    </shippingMethodServices>

    This is where I start to get lost a bit. I can now select MyShippingMethodService in the uCommerce UI, so that's something.

    I'm looking at http://www.ucommerce.dk/docs/html/T_UCommerce_Entities_Shipment.htm to try and get a clue as to what to do with that shipment object. I'm guessing, like Sean said, I need to look at some property (i.e. a delivery price) on each item in the shipment, but I'm not sure what object to iterate to do that, or how to look at a property.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 03, 2011 @ 16:54
    Søren Spelling Lund
    0

    Hi Zac,

    Your method will be executed when you run through the check out flow. I assume that you've got the uCommerce Store installed.

    Basically you need to add a new shipment to the order with the shipping method that you set up in uCommerce. With that in place uCommerce will execute your code when the basket pipeline is run (CommerceLibrary:ExecuteBasketPipeline()).

    I'm going to sit down tonight a write a more thorough guide on how to do it, but this should get you started.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 10, 2011 @ 22:47
    Søren Spelling Lund
    0

    Hi Zac,

    It took a little longer getting the article out the door, but as compensation I went ahead and did a bonus one for a total of two :)

    First one explains Shipping Methods and the second explain how to extend them with your own code to do custom shipping cost calculations.

  • Zac 223 posts 575 karma points
    Feb 11, 2011 @ 10:49
    Zac
    0

    Søren,

    You are awesome.

    Sincerely,

    Zac

    (But seriously, thank you very much!)

Please Sign in or register to post replies

Write your reply to:

Draft