Page 1 of 1

Digital Goods serial number generation

Posted: Tue Jan 22, 2008 11:31 am
by DS1
Hello,

I am trying to change the serial key provider. For this I am creating a class which inherits from CommerceBuilder.DigitalDelivery.DefaultSerialKeyProvider and overriding AcquireSerialKey() to implement my custom serial key generation logic.

To generate keys for the correct product, I need the Product ID(s) or SKU(s). Does anyone know how I can access product information from the order?

Thank you in advance.

Posted: Tue Jan 22, 2008 3:55 pm
by AbleMods
Try the Token class. I know it provides current store and user information.

Usually Able passes the ProductId as a session state object though when jumping from class to class. At least that's as far as I my knowledge can understand it...still learning this advanced ASP.Net stuff.

Posted: Tue Jan 22, 2008 5:46 pm
by AbleMods
Or better still, try PageHelper.GetProductId() or PageHelper.GetOrderId()

So something like this (VB):

Code: Select all

DIM _Product as Product = ProductDataSource.Load(PageHelper.GetProductId())
or

Code: Select all

DIM _Order as Order = OrderDataSource.Load(PageHelper.GetOrderId())
Then you can work with the strongly-typed version of the data you need.