Developer forum

Forum » Development » Discount price on product

Discount price on product

Umar Farooq
Reply

Hi,

We have two shops and some products from shop A is been displayed in Shop B and vise versa. the discount price is comming from ERP system adn we were using Discounts object to add Discount price to product

product.Discounts.Price.PriceWithoutVAT = ERPDiscountPrice;

This approach worked until we updated dw to DW 9.8.5 and most of the methods has been depricated (even though i tried all of them but could get them to work). most of these methods suggest to use overload method with these 5 parameters "currency, country, unit id, user id, shop id" but this overload method doesn't exist. 

In Api Doc it suggest to use Product.GetDiscounts Method (Currency, Country, String, String)  and this method should be available is  Dynamicweb.Ecommerce.dll Version: 1.9.0. and this vervion not to be found anywhere.

 

Anyhow, i used following method 

       Product.GetDiscounts(Currency, Country, String, String).Price.PriceWithoutVAT = ERPDiscountPrice;

and it did added the discount on Products but only on to the products which are in the shop we are on, And it didn't displayed any discount on products which belongs to Shop B.

 

Am i missing something here or is there any other way to handle this ?

/umar

 

 

 

 


Replies

 
Nicolai Pedersen
Reply

It is very lucky that this even works! I was not designed to work like that. Anyhow.

Product.GetDiscounts(Currency, Country, String, String) is the right method and also exist in 9.8.

The last parameter in that method is the shopid. If you call the method with a specific shopid, the discount will only apply to that shop. If you feed that last parameter with string.empty, it should work for all shops.

 

You must be logged in to post in the forum