Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
Umbraco 7 Teacommerce 2.3.2
I need to calculate a new price on some of the products.
On the ducomenttype of the product i have a checkbox "addDiscount".
When this is checked i shold use the price from a field "discountPrice"
I have got the example from http://documentation.teacommerce.net/net-api/price-calculators/order-calculator/
This part works. and i have got the discount added on all products.
protected override Price CalculateOrderLineUnitPrice(OriginalUnitPrice originalUnitPrice, OrderLine orderLine, Currency currency, Order order) { //10% discount when buying 5 or more return new Price(orderLine.Quantity >= 10M ? originalUnitPrice.Value * 0.9M : originalUnitPrice.Value, orderLine.VatRate, currency); }
If i could get a small hint in the direction of getting the property from the product "addDiscount"
If this is checked use the "discountPrice" and return the new discountPrice.
This should only be for the orderline with the specifik product. Not the entire order
René
If you add the property alias "addDiscount" to the "Product property aliases" in settings for the store. Then TC will copy that information to your order line and you now have it at orderLine.Properties["addDiscount"]
Hope that helped
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Discount - Buy 10 get alternative price
Hi
Umbraco 7
Teacommerce 2.3.2
I need to calculate a new price on some of the products.
On the ducomenttype of the product i have a checkbox "addDiscount".
When this is checked i shold use the price from a field "discountPrice"
I have got the example from http://documentation.teacommerce.net/net-api/price-calculators/order-calculator/
This part works. and i have got the discount added on all products.
If i could get a small hint in the direction of getting the property from the product "addDiscount"
If this is checked use the "discountPrice" and return the new discountPrice.
This should only be for the orderline with the specifik product. Not the entire order
René
If you add the property alias "addDiscount" to the "Product property aliases" in settings for the store. Then TC will copy that information to your order line and you now have it at orderLine.Properties["addDiscount"]
Hope that helped
is working on a reply...