Digital Goods serial number generation

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
DS1
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Mon Jan 21, 2008 2:22 pm

Digital Goods serial number generation

Post by DS1 » Tue Jan 22, 2008 11:31 am

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.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Jan 22, 2008 3:55 pm

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Jan 22, 2008 5:46 pm

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply