Needs review
Project:
Commerce AutoSKU
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 17:29 UTC
Updated:
17 Feb 2016 at 16:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rbayliss commentedThis should be possible with a bit of custom code. You'll need a hook_token_info() and a hook_tokens() to provide a token that determines the product's id in the sequence (the 5th t-shirt, etc). I suspect this will be pretty similar to what you did for nodes previously.
Comment #2
Salman_Rahma commentedThank you for your suggestion. The PHP code I used before was only for formatting the output and I had copied from some site. unfortunately I am not a coder and I think this would be a nice feature to be added out of the box for the module.
Comment #3
kmolkens commentedI have a similar request.
It would be interesting to have the possibility to add a Pattern for the SKU based on custom PHP code.
In Drupal6/Ubercart, I used Product Power Tools allowing a field for entering PHP code.
This is very useful to calculate a SKU used for barcode scanning.
The code calculates a sku conform to EAN-8 or EAN-13 or ... barcode numbers (including checksum,...).
Comment #4
kevinsiji commentedHere is a patch.
This will also provide a facility to decide the starting number.
You can provide the static part of the sku in the token pattern (a real token is not necessary) and the starting number in the textbox provided under the 'Advanced' fieldset.
Criticize this patch, so that I will learn my mistakes.
Comment #5
socialnicheguru commentedI would like an option to add this to the end of my tokenized autosku value.