matt-awg
-
1/3/2013 11:36:04 AM
Extending the ShoppingCartInfo Class?
I am doing some custom shipping calculations using a custom ShippingOptionInfoProvider. I am overriding the CalculateShippingInternal method which accepts a ShoppingCartInfo object as a parameter. I have it working except for one problem, I need to pass some additional information into this function but I don't want to change the function definition since then I have to touch everywhere that calls this. I am thinking the ideal way to do this is to extend the ShoppingCartInfo class and add a custom property so I can add the value for that property in the custom shopping cart code I have added and then I can access this property on the shoppingCartInfo object being passed in to the CalculateShippingInternal method already. At least, I think this could work. Is this possible and if so, how do I go about doing it? If not, do you have any other suggestion as to how I can pass data into this custom ShippingOptionInfoProvider from the custom cart step I created?
|