Discussions

Unique identifier for each ordered cocktail?

Is there an easy way to have Commerce auto-assign a number for each ordered item?

For example, in an imaginary online bar- a customer might order many cocktails and I would like each cocktail in the cart to be auto-assigned its own unique number (1, 2, 3, 4...). Each time a new (or existing) customer would place an order for a cocktail, Commerce would pick up where it last left off (5, 6, 7, 8....). That way I can track each ordered item throughout the cocktail mixing/delivery pipeline, simply by following the specific number like an SKU.

Posted: Apr 4, 2012

Comments

mwisner on April 5, 2012

Do they have to be in order?

Products are order line items and line items have a unique ID for every line item. Could you use that?

MM10 on April 6, 2012

Thanks! I looked into the line item ID and see that it is serial and it will work fine. Stop by for a drink!