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.

  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 13:01
    Tony Kiernan
    0

    Custom Shipping Method

    Reading Søren's article on Building a Custom Shipping Method Service.  Which seems easy enough.  Having a few issues.

    1. Will this work with EntitiesV2?
    2. Where do I find Subsonic.Core.dll? It's certainly not in my uComerce installation
  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 13:07
    Tony Kiernan
    0

    Does this work?

    return new Money(shippingPrice, shipment.OrderLines.First().PurchaseOrder.BillingCurrency); 

    For

    return new Money(shippingPrice, shipment.OrderLines.First().PurchaseOrder.PurchaseOrder.PurchaseOrders.Single().Currencies.Single()); 
  • Anders Lund 17 posts 38 karma points
    Jul 20, 2011 @ 13:47
    Anders Lund
    0

    Hi Tony

    I'm pretty sure that everything should work with EntitiesV2. These should be used from now on. The ealier version of uCommerce was build on top of the Subsonic ORM, but it is changed as nHibernate was found to be much more robust. So EntitiesV2 is basically just the API rebuild on nHibernate. Use these classes at all time.

    Se Søren's post about the EntitiesV2 here.

  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 14:01
    Tony Kiernan
    0

    The point of my first question was that it doesn't work with EntitiesV2.  There are many references that are not valid.  So, I guess it doesn't work.  (If anyone's interested, my replacement text didn't seem to work either)

    No need for subsonic.  Cool.

  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 14:06
    Tony Kiernan
    0

    To clarify (sorry, edit not working for me):

    Using Entities 'Shipment' is undefined.

    Using EntitiesV2 'shipment.OrderLines.First().PurchaseOrders' is not defined

  • Tony Kiernan 278 posts 341 karma points
    Jul 20, 2011 @ 18:10
    Tony Kiernan
    0

    With a bit of trial and error, combining this kinda stuff with the article above should see you right

    public Money CalculateShippingPrice(Shipment shipment)
            {  
                PurchaseOrder purchaseOrder = shipment.PurchaseOrder;

                decimal shippingCost= 10;

                return new Money(shippingCost, CultureInfo.InvariantCulture, purchaseOrder.BillingCurrency);
    }
  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 28, 2011 @ 17:26
    Søren Spelling Lund
    0

    Hi Tony,

    Sorry for the confusion. Anders is right that you should use EntitiesV2 from the UCommerce.dll. Subsonic.Core is no longer shipped with uCommerce 2.0 so just ignore it.

    We still need to revise the existing docs to reflect the new API instead of the old.

  • Rob Scott 41 posts 94 karma points
    Jul 14, 2015 @ 03:01
    Rob Scott
    1

    Might want to edit the docs b/c I'm seeing this 4 years later =\

    http://docs.ucommerce.net/ucommerce/v6.7/extending-ucommerce/shipping-method-service.html

    Volume Based Shipping Method Service

    Volume and weight based shipping pricing are probably the most common shipping scenarios for an online store so lets try and build one of them as an example. First you’ll need to create a new Visual Studio project and add a reference to the UCommerce.dll assembly. You will also need a reference to the Subsonic.Core.dll assembly. With that in place you’re ready to start implementing the service.

Please Sign in or register to post replies

Write your reply to:

Draft