Inhalte aufrufen

Profilbild

Selling downloadable products with unique license (product/serial) key codes

product key license code serial number

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
2 Antworten zu diesem Thema

#1 coliff

coliff

    Newbie

  • Members
  • Punkt
  • 2 Beiträge

Geschrieben: 31 March 2016 - 11:38

We need to be able to sell a downloadable product (software) with each order including a unique product key code. Can Smartstore.NET deal with that via an available plugin?


  • RidgeOi gefällt das

#2 Frank Crowder

Frank Crowder

    Newbie

  • Members
  • Punkt
  • 3 Beiträge

Geschrieben: 23 June 2016 - 16:23

can anyone provide me the point in code that creates the email sent to the customer for "order complete here is your order info"? at this point I can add my hook to create my product key and add it to the email.

 

frank



#3 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 23 June 2016 - 18:20

Just a blueprint:

public class OrderTokensAddedEventConsumer : IConsumer<EntityTokensAddedEvent<Order, Token>>
{
	public void HandleEvent(EntityTokensAddedEvent<Order, Token> eventMessage)
	{
		var entity = eventMessage.Entity;
		var tokens = eventMessage.Tokens;

		// fetch the license key assigned to the given order from wherever you saved it 
                // (generic attributes, session etc.)
		var licKey = "xxx-xxx-xxx";
		
		// add your token to the list of available message tokens
		tokens.Add(new Token("Order.MyLicenseKey", licKey));
	}
}

Rendering custom message tokens involves editing the corresponding message templates in CMS > Message Templates (e.g the template OrderPlaced.CustomerNotification). Just place the token %Order.MyLicenseKey% anywhere in the message body.


  • Frank Crowder gefällt das

Murat Cakir
SmartStore AG



Auch markiert mit einem oder mehrerer dieser Schlüsselwörter: product key, license code, serial number