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.

  • Gilles Faessler 29 posts 53 karma points
    Sep 14, 2012 @ 14:36
    Gilles Faessler
    0

    Degressive pricing

    We are evaluating the use of Ucommerce for a Shop where people could order printed banners, roll-up...

    The product selection and price calculation would be using a "Product Configurator" model like the one described on http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/23294-Building-an-Apple-style-Product-Configurator.

    Regarding the options there will be :
    - Size
    - Finition (A or B)
    - Service (A or B)

    The thing is that the size option pricing model is not linear. It's degressive. (1-2m2 = 100.-/m2, 2-5m2 = 85.-/m2, ...). The other options pricing calculation is fixed per m2.

    From what I have seen, the way to go to calculate the product price would be to extend the iPricingService interface ?

    Moreover we have a "nice to have" feature which would be that the price per m2 is not calculated per item but on the number of items x the size of the item. Would this be manageable by extending the iPricingService ?

    Thanks

    Gilles

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 17, 2012 @ 11:15
    Søren Spelling Lund
    0

    Extending the price service is definitely the way to go. I assume that you can't price the individual components of the configuration so what I'd do is have the price service look for the top level of the configuration and calculate prices for that based on its subcomponents.

    The price service will receive requests to calc price for the components as well, in which case I'd simply return a price on zero.

    For the m2 calculation you could go with a different approach which is basically to calculate price on a per order line bases using the basket pipeline. This would effectively let you override the price calculated by uCommerce by having the first step in the basket be your overriding logic. For the scenario you describe where you need additional contextual information it would make sense to go with this approach.

  • Gilles Faessler 29 posts 53 karma points
    Sep 19, 2012 @ 14:35
    Gilles Faessler
    0

    Thanks Soeren for the precious information provided.

    I just have an additional question regarding the iPricingService interface. I had a look at it and I see two methods :

    GetProductPrice(Product, ProductCatalog) and
    GetProductPrice(Product, PriceGroup)  

    Both methods are based on the product + productCatalog or priceGroup. In my case the price will depend on total square meters which results in the quantity multiplied by the size of the product. From what I see there is no way to have contextual information trough the iPricingService interface.

    I could calculate price on a per order line using basket pipeline but what I would like is to display the price for the base product and for each option directly in the product configurator so the visitor can compare the different options and prices.

    Thanks

    Gilles 

     

    Interface

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 24, 2012 @ 09:59
    Søren Spelling Lund
    0

    I see.

    In that case what you want to do is provide the pricing service with some context and do the price calc multiple times per product.

    Basically what you can do is create a custom property on the product, which specifies the number of "m2" you want to display a price for:

    var product = Product.SingleOrDefault(x => x.Sku == "mySku" && x.VariantSku == "myVariantSku");
    product["m2"].Value = "10";

    var priceService = ObjectFactory.Instance.Resolve<IPricingService>();
    PriceGroupPrice priceFor10SqMeters = priceService.GetProductPrice(product, catalog);

    product["m2"].Value = "20";
    PriceGroupPrice priceFor20SqMeters = priceService.GetProductPrice(product, catalog); 

    Inside the price service you'll look at the "m2" property and perform the calculation based on that. 

    Hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft