Developer forum

Forum » Development » Discount with usergroup or member

Discount with usergroup or member

Kim Søjborg Pedersen
Reply
How can I check if a discount is connected to a specifik usergroup?

Usercase: a user is logged on and I need to show all products with a discount, but only if the discount is connected to the same usergroup as the current user.

Replies

 
Morten Snedker
Reply
Hi,

You can do this with a product(list) template extender. The information from the discount can be found in table EcomSalesDiscount; the Extranet group from column SalesDiscountCustomersAndGroups. Par this with the the current logged in users group relations.

Hope it makes sense - otherwise feel free to write back (I'll try to be more swift!)  :-)

Regards /Snedker
 
Kim Søjborg Pedersen
Reply
It makes sense and it is the same solution as I thought myself, but I I was hoping on a solution through the API. Because of the name convention it almost impossible to do it in one SQL. In AccessUser the AccessUserGroups is @256@ and in table  EcomSalesDiscount - SalesDiscountCustomersAndGroups the same groups is named as GRP_256
 
Kim Søjborg Pedersen
Reply
If I bypass the API and make the solution with a System.Data.IDataReader DR = Database.getDataReader("SELECT * FROM EcomSalesDiscount", "EcomSalesDiscount.mdb"); and then doing some compare of @256@ in the AccessUser table and the value GRP_256 In EcomSalesDiscount is it going to work in DW 8?

 
Nicolai Høeg Pedersen
Reply
I believe it will.

You need a recompile and maybe update some namespace references, but data and format are the same.

 

You must be logged in to post in the forum