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
I would like to increase variant price with a percentage from a property set in Umbraco. I show the price like this:
TC.GetPrice(1, Model.Content.Id + "_" + variant.VariantIdentifier);
I also made a property on each product category with a Decimal input that increases prices with that amount.
For a regular price I do the following, where the ThePercentageToIncrease is a decimal property in Umbraco, it works just fine:
price = (CurrentPage.GetPropertyValue("price") / ThePercentageToIncrease * 100);
But how can I take the variant price and increase it with the decimal property from Umbraco?
The error I get is:
Operator '*' cannot be applied to operands of type 'Price' and 'int'
My guess is because the the price returned from TC is of type Price which is a complex object made up of a pre tax value, a tax value, and a inc-tax value and so a Price can't simply be multiplied. You'll have to multiply the individual parts and construct a new Price value from the results.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted