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.
Developer forum
E-mail notifications
Discount with usergroup or member
Kim Søjborg Pedersen
Posted on 12/12/2011 10:31:50
Replies
Morten Snedker
Posted on 13/12/2011 14:33:51
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
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
Posted on 13/12/2011 14:58:15
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
Posted on 16/12/2011 13:49:58
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
Posted on 16/12/2011 15:28:45
I believe it will.
You need a recompile and maybe update some namespace references, but data and format are the same.
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