Developer forum

Forum » Ecommerce - Standard features » Add to usergroup on purchase

Add to usergroup on purchase

Rune Skovbo
Reply

Hi there

 

I'm trying to create a possibility to purchase a membership via eCom.

 

The thought is that when you buy a product called Membership, you are placed in a specific user group, that have permissions to the protected parts of the page.

 

Seams like a simple enough request, but I can't see the solution without too much javascript and auto submits on user forms.

 

Any clever solutions?

 

/Rune


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Rune

 

You can do an notification subscriber and do something like this:

 

Dynamicweb.Modules.UserManagement.User.GetCurrentUser().AddToGroup(21492);

 

Use the CheckoutDone notification subscriber:

http://developer.dynamicweb-cms.com/api8/#Dynamicweb~Dynamicweb.Notifications.eCommerce+Cart~CheckoutDoneOrderIsComplete.html

 
Rune Skovbo
Reply

Hi Nicolai

 

Thanks for the quick reply.

 

I'm afraid that solution is beyond my technical level. I was hoping for a front-end solution to this.

 

Perhaps when razor is fully support, I should learn it and be able to do stuff like this?

 

/Rune

 
Nicolai Høeg Pedersen
Reply

Yes.

 

Or I'm pretty sure you can find some DW partner with the required technical skills to do this for a low cost. I.e. html24.dk, Blackworks.dk or codesquare.dk

 

BR Nicolai

 
Rune Skovbo
Reply

Hov, kan det klares på en eller anden snedig måde med snippets?

 

Kan jeg få lov til at tilgå usergroup loopet indi i min kvitteringsskabelon på den måde?

 

/Rune

 
Nicolai Høeg Pedersen
Reply

Probably you can.

 

You can add the user management module to the same page as the cart, and maybe do some magic with that. But it sounds kind of shaky.

 

BR Nicolai

 
Rune Skovbo
Reply

Yeah, shaky is what im trying to avoid :-)

 

Thanks again.

 

/Rune

 

You must be logged in to post in the forum