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.

  • Sonni Tost 20 posts 72 karma points
    Nov 23, 2012 @ 09:49
    Sonni Tost
    0

    Custom Shipping / uCommerce 3

    Hi all,

    I have just started out on a new uCommerce-site - and I am trying to build a custom shipping method. I have followed (and adjusted) the method using this tutorial
    http://www.publicvoid.dk/BuildingACustomShippingMethodService.aspx

    The build completes without any problems - however it fails when I try to hook up the the shipping method to my uCommerce solution in the shipping.config. I am not quite sure about what to put in the shipping.config.

    I have made my shipping method in a namespace called UCommerceCustom and named the class freeShippingCostRelated and that is inherited from IShippingMethodService.

    This is what my shipping.config looks like:
    <component id="TestShippingService"
    service="freeShippingCostRelated, UCommerceCustom"
    type="UCommerce.Transactions.Shipping.SinglePriceShippingMethodService, UCommerce" />

    When I use the above - all xslt on the front-end fails and the back-end comes up with this error:
    "Could not convert from 'freeShippingCostRelated, UCommerceCustom' to System.Type - Maybe type could not be found"

    This site is running on Umbraco 4.9.0 using uCommerce 3.0.0.12306

    Sonni T.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Nov 27, 2012 @ 23:09
    Søren Spelling Lund
    0

    Hi Sonni,

    When you're registering a new shipping provider (or any service really) with uCommerce you only want to modify the "type" attribute of the component. With that in mind your registration changes to:

    <component id="SinglePriceService" 
    service="UCommerce.Transactions.Shipping.IShippingMethodService, UCommerce"
    type="freeShippingCostRelated, UCommerceCustom"/>

    The service attribute contains the "contract" of the service, i.e. what are the methods, properties, fields, etc. that the service deals with. While the "type" contains the actual thing that contains the logic that implements your service.

    You'll see this pattern repeated throughout the uCommerce component configuration.

  • Sonni Tost 20 posts 72 karma points
    Nov 29, 2012 @ 16:22
    Sonni Tost
    0

    Hi Søren,

    Thank You for your input. However it did not fix the problem. Is there anything else I have to do to register the custom shipping except to copy the .dll / .pdb to the bin directory and add it to shipping.config?

    The xslt still fails on the front-end and when I try to access the backend it says: "Could not convert from 'freeShippingCostRelated, UCommerceCustom' to System.Type - Maybe type could not be found"

    My shipping.config now looks like this:

    <configuration>
    <components>
    <!--<component id="SinglePriceService" service="UCommerce.Transactions.Shipping.IShippingMethodService, UCommerce" type="UCommerce.Transactions.Shipping.SinglePriceShippingMethodService, UCommerce"/>-->
    <component id="SinglePriceService" service="UCommerce.Transactions.Shipping.IShippingMethodService, UCommerce" type="freeShippingCostRelated, UCommerceCustom"/>
    </components>
    </configuration>

    Sonni T.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 07, 2012 @ 20:27
    Søren Spelling Lund
    1

    Hi Sonni,

    The format is actually this:

    type="Namespace.Class, DLLName"

    Say I've got a class that looks like this in an assembly called "MyAssembly":

    namespace MyNamespace
    {
      public class MyClass
      {
      }

    The registration will look like this:

    type="MyNamespace.MyClass, MyAssembly"

    I'm guessing that we're missing the namespace part in the registration for your service.

  • Sonni Tost 20 posts 72 karma points
    Dec 10, 2012 @ 13:48
    Sonni Tost
    0

    Hi Søren,

    That did the trick! :-)

    Thank You for Your help!

     

    Sonni T.

  • Kuttikrishnan.P 6 posts 26 karma points
    Dec 18, 2012 @ 17:16
    Kuttikrishnan.P
    0

    Hi ,

    I wanted to implement the custom shipping methods in my Ucommerce site . I have followed the same steps which you had mentioned above . But I am not able to see the newly created shipping service in my Ucommerce admin console . Even i delete the existing shipping method service "SinglePriceServicefrom my "Shipping.config" file , still it appearing in my UCommerce admin console ("Ucommerce>Setting>Orders>ShippingMethod"). Even I delete  "Shipping.config" from my solution , still it shows the default shipping method service in the admin console .

    So my first doubt is , from where this "Shipping Method service" appearing in the drop down (present in the admin console). .

    If I want to add a new shiiping method service from where should i start .

    For your kind information :I am using Ucommerce free edition . Ucommerce version "uCommerce-3.0.0.12278"

    So Please guide me to create a simple custom shipping method service . Also please share if you have any ready made code / package available for this.

    Regards,

    Kutti

     

     

  • Sonni Tost 20 posts 72 karma points
    Dec 19, 2012 @ 11:28
    Sonni Tost
    0

    Hi Kutti,

    When You have made Your shipping method, You can add it in umbraco/ucommerce/configuration/shipping.config

    I have uploaded my super simple shipping method class here: http://test.pajor.dk/ucommerceCS/freeShippingCostRelated.zip - It is very simple - but it works and can be extended :-) In order to make it work You have to make a reference to ucommerce.

    I hope this helps.

    Kind regards,

     

    Sonni T.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Dec 21, 2012 @ 13:31
    Søren Spelling Lund
    0

    Hi Kutti,

    The reason your custom shipping service is not showing up is that uCommerce will only reload config at app start. If you recycle your app pool or resave web.config configs will be reloaded.

    Also you can go ahead and using Custom.config to register your shipping service. That will ensure that your customizations will remain even if you update uCommerce.

    Hope this helps.

  • Elvin Loo 20 posts 63 karma points
    Sep 23, 2014 @ 09:59
    Elvin Loo
    0

    Hi guys,

    I'm having the same issue as Kuttikrishnan. 

    We seemed to have follow the exact instructions provided in Soren's article but the custom shipping method still doesn't seem to show up in the dropdown.

    I've also tried, touching the web.config and still it doesn't change anything.

    Can someone think of anything I may missed out on?

    This is my Shipping.config

    <configuration>
     <components>

    <component id="CustomShipping" service="UCommerce.Transactions.Shipping.IShippingMethodService, UCommerce" type="CustomeShipping.VolumeShippingMethodService, CustomeShipping" />

     </components>
    </configuration> 

     

     

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft