I've added a class library to my solution that is referenced by my site:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UCommerce; using UCommerce.Api; using UCommerce.EntitiesV2; using UCommerce.Transactions.Shipping;
namespace MyNamespace { public class VolumeShippingMethodService : IShippingMethodService { public Money CalculateShippingPrice(Shipment shipment) { int totalQuantity = 0; foreach (OrderLine orderline in shipment.OrderLines) { totalQuantity += orderline.Quantity; }
return new Money(shippingPrice, shipment.PurchaseOrder.BillingCurrency); }
public bool ValidateForShipping(Shipment shipment) { if (shipment.ShipmentAddress != null) throw new InvalidOperationException("Cannot validate shipment for country. Remember to set the shipping address for shipment.");
var shippingMethod = shipment.ShippingMethod; if (shippingMethod == null) throw new InvalidOperationException( "Cannot validate destination country for shipment. It does not contain a shipping method. Remember to add a shipping method to your shipment before validating.");
/// /// Validates the order lines according to their desired destination and configured contries for shipping method /// /// protected virtual bool ValidateShippingDestination(OrderAddress shippingAddress, ShippingMethod shippingMethod) { var eligibleCountries = shippingMethod.EligibleCountries;
// No eligible countries exist - so the shipment isn't valid if (eligibleCountries == null) return false;
The namespace I'm using is the same as the assembly name.
I've touched the web.config file, attempted to override SinglePriceService, and have tried adding the component line to shipping.config instead. For the life of me, I can't get this to show up or have any effect.
I'd be extremely grateful for any help anyone can offer.
So the name of the assembly is MyNamesapce? Just want to make sure :)
Also you need to make sure that you have only one components.config in your entire site. Sometimes VS and other tools publish files to various locations under the root.
If you search for components.config, how many hits do you get? This error is fixed in a later version of uCommerce, so if you're running an old version you should upgrade!
How to add custome field or custome variable in Transaction.GetBasket.PurchaseOrder because i want to pass "product description" to worldpay for shopper response in email but i don't know how to do this. Or any other way to pass Product description to worldpay through ucommerce.
Code:
Dim opProduct AsProduct
opProduct = CatalogLibrary.GetProduct(oLine.Sku) oBasket.AddProduct(SiteContext.Current.CatalogContext.CurrentCatalog.PriceGroup, opProduct, 1)
Unable to Add Custom Shipping Service - Umbraco 7 uCommerce 6
Hi all,
I'm using Umbraco 7 and ucommerce 6. I'm attempting to add a custom volume-based shipping service as described in http://docs.ucommerce.net/ucommerce/v6/extending-ucommerce/shipping-method-service.html.
I've added a class library to my solution that is referenced by my site:
I've also added the following to the Custom.config file (brackets omitted to avoid post getting flagged as spam):
The namespace I'm using is the same as the assembly name.
I've touched the web.config file, attempted to override SinglePriceService, and have tried adding the component line to shipping.config instead. For the life of me, I can't get this to show up or have any effect.
I'd be extremely grateful for any help anyone can offer.
Thank you in advance!
Ben
So the name of the assembly is MyNamesapce? Just want to make sure :)
Also you need to make sure that you have only one components.config in your entire site. Sometimes VS and other tools publish files to various locations under the root.
If you search for components.config, how many hits do you get? This error is fixed in a later version of uCommerce, so if you're running an old version you should upgrade!
Best regards
Morten
Thanks Morten! The issue was multiple configs. I'm using v6.1.0.14195.
Ben
I experienced this same issue - Fresh umbraco install ucom: 6.1.0.14195
Morten's suggestion cured my issue as well.
Refresh you obj folder (delete it) - touch your web.config; and they should appear.
Cheers,
Josh
How to add custome field or custome variable in Transaction.GetBasket.PurchaseOrder because i want to pass "product description" to worldpay for shopper response in email but i don't know how to do this. Or any other way to pass Product description to worldpay through ucommerce.
Code:
is working on a reply...