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
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:
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.
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"
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 "SinglePriceService" from 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.
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.
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.
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?
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.
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:
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.
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.
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":
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.
Hi Søren,
That did the trick! :-)
Thank You for Your help!
Sonni T.
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 "SinglePriceService" from 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
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.
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.
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>
is working on a reply...