{"action":"opened","issue":{"url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/1475","repository_url":"https://api.github.com/repos/nopSolutions/nopCommerce","labels_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/1475/labels{/name}","comments_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/1475/comments","events_url":"https://api.github.com/repos/nopSolutions/nopCommerce/issues/1475/events","html_url":"https://github.com/nopSolutions/nopCommerce/issues/1475","id":159058141,"number":1475,"title":"Discount for combination overriden price is not applied","user":{"login":"ArturAlekseev","id":9645980,"avatar_url":"https://avatars.githubusercontent.com/u/9645980?v=3","gravatar_id":"","url":"https://api.github.com/users/ArturAlekseev","html_url":"https://github.com/ArturAlekseev","followers_url":"https://api.github.com/users/ArturAlekseev/followers","following_url":"https://api.github.com/users/ArturAlekseev/following{/other_user}","gists_url":"https://api.github.com/users/ArturAlekseev/gists{/gist_id}","starred_url":"https://api.github.com/users/ArturAlekseev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArturAlekseev/subscriptions","organizations_url":"https://api.github.com/users/ArturAlekseev/orgs","repos_url":"https://api.github.com/users/ArturAlekseev/repos","events_url":"https://api.github.com/users/ArturAlekseev/events{/privacy}","received_events_url":"https://api.github.com/users/ArturAlekseev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-08T01:04:36Z","updated_at":"2016-06-08T01:04:36Z","closed_at":null,"body":"Some times we need to have different price for each product combination. Then the only option to do it is to use Overriden Price property.\r\nBut for these prices discounts are not applied (but should):\r\n\r\nIn GetUnitPrice there is a check:\r\n\r\nif (combination != null && combination.OverriddenPrice.HasValue)\r\n\r\nthen discount is not applied.\r\n\r\nA way to fix it:\r\n\r\n**decimal? initialprice = null;\r\n                if (combination != null && combination.OverriddenPrice.HasValue)\r\n                {\r\n                    initialprice = combination.OverriddenPrice.Value;\r\n                }**\r\n\r\nfinalPrice = GetFinalPrice(product,\r\n                        customer,\r\n                        attributesTotalPrice,\r\n                        includeDiscounts,\r\n                        qty,\r\n                        product.IsRental ? rentalStartDate : null,\r\n                        product.IsRental ? rentalEndDate : null,\r\n                        out discountAmount, out appliedDiscount, **initialprice**);\r\n\r\nIn GetFinalPrice\r\n//initial price\r\n                decimal price;\r\n                if (InitialPrice.HasValue) price = InitialPrice.Value; else price = product.Price;"}}
{"actor":{"display_login":"ArturAlekseev"}}