Is there a straightforward way to implement a pricing service that takes into account the quantity being ordered? I am building a shop for a wholesaler who would like functionality such that if a customer orders 1 to 10 items, they get it at price A, 11 to 50 ships at price B. The quanty/price boundary is different for different products.
I notice that IPricingService only allows for parameters of product and priceGroup, so it's not clear how to extend this to include quantity.
Would overriding CalculateOrderLineTotalsTask in the basket pipeline be a good approach?
I suppose it coud be done with the marketing foundation. There you can make a campaign that gives a discount on products based on the quantity. (I would assume)
But it could get quite messy aswell so I'm not sure it would be the best approach, just the only one that springs to mind.
I had a look at something similar to this and think that overriding or replacing CalculateOrderLineTotalsTask is an OK approach. My understanding is that the purpose of the pipelines is to enable you add, remove and update how everything is calculated. I have made a few modifications to the pipelines on a project I am working on.
I think one of the most difficult issues will be in creating the interface for adding the prices into.
I guess you could create a custom document type as these can now be used by the latest version of uCommerce. There may already be a document type out there which suits this purpose.
I'm having problems at the moment making any changes to the basket pipeline. I've tried adding my override in the Custom.config - no change. I then made changes directly to the Basket.config (including trying to deliberatly break it as below)
Still no luck getting my config file changes to be applied. Can't find any references to them being cached anywhere. Any insight into this greatly appreciated.
Just worked out that my config files aren't getting written to the output directory when the solution builds. It may be something to do with Visual Studio. I'll mark this as closed.
regarding the last post. Build scripts copies what you have set it up to copy. From standard it doesn't copy files that aren't included in your project.
I would assume that it is enough. But you could try to right-click your project and select properties. under there you'll find Package/Publish Web. It has a section "items to deploy" where you can select which items to deploy. Hit all files in this project , if you have included the file, otherwise try all files in the project folder.
It's not a problem with publishing the site - it's when I build locally that I'm noticing that the config files aren't being copied to the obj\debug folders.
Quantity-dependent pricing service
Hi there,
Is there a straightforward way to implement a pricing service that takes into account the quantity being ordered? I am building a shop for a wholesaler who would like functionality such that if a customer orders 1 to 10 items, they get it at price A, 11 to 50 ships at price B. The quanty/price boundary is different for different products.
I notice that IPricingService only allows for parameters of product and priceGroup, so it's not clear how to extend this to include quantity.
Would overriding CalculateOrderLineTotalsTask in the basket pipeline be a good approach?
Kind regards,
Karl
I suppose it coud be done with the marketing foundation. There you can make a campaign that gives a discount on products based on the quantity. (I would assume)
But it could get quite messy aswell so I'm not sure it would be the best approach, just the only one that springs to mind.
Thanks Niels,
We're using the free version, I'm afraid. I understand that Marketing Foundation isn't available.
Karl
Hi Karl,
I had a look at something similar to this and think that overriding or replacing CalculateOrderLineTotalsTask is an OK approach. My understanding is that the purpose of the pipelines is to enable you add, remove and update how everything is calculated. I have made a few modifications to the pipelines on a project I am working on.
I think one of the most difficult issues will be in creating the interface for adding the prices into.
I guess you could create a custom document type as these can now be used by the latest version of uCommerce. There may already be a document type out there which suits this purpose.
Adam
Thanks Adam,
I'm having problems at the moment making any changes to the basket pipeline. I've tried adding my override in the Custom.config - no change. I then made changes directly to the Basket.config (including trying to deliberatly break it as below)
... no change. I even tried braking it by changing the path to the Basket.config in the Components.config!
Any idea where is it reading the pipeline tasks from if not from these files?
Also, do you have any links to pages which show how to use the custom document types in the way you describe?
Many thanks,
Karl
Im pretty sure you need to recycle the app pool for the pipeline changes to take effect (chancing the xml file doesnt seem to cause a refresh)
I cant find documentation but in ucommerce > settings > definitions > datatypes, you create a new data type and select the umbraco data type to use.
Hi Adam,
I did try changing the web.config to force through the changes - I'll try just going for a full re-boot.
Thanks for your help.
Karl
Still no luck getting my config file changes to be applied. Can't find any references to them being cached anywhere. Any insight into this greatly appreciated.
Karl
Just worked out that my config files aren't getting written to the output directory when the solution builds. It may be something to do with Visual Studio. I'll mark this as closed.
Hi Karl.
regarding the last post. Build scripts copies what you have set it up to copy. From standard it doesn't copy files that aren't included in your project.
Thanks, Morten.
I've set the Basket.config properties such that "Copy to output directory" is set to "Copy always". Is there anything else I should be doing?
I would assume that it is enough. But you could try to right-click your project and select properties. under there you'll find Package/Publish Web. It has a section "items to deploy" where you can select which items to deploy. Hit all files in this project , if you have included the file, otherwise try all files in the project folder.
It's not a problem with publishing the site - it's when I build locally that I'm noticing that the config files aren't being copied to the obj\debug folders.
is working on a reply...