Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is no interface to use this module for products that are not created using Product UI. I have a product in my custom module as below:
/**
* Implements hook_commerce_product_type_info().
*/
function custom_product_commerce_product_type_info() {
return array(
'room' => array(
'type' => 'custom_product',
'name' => t('Custom Product'),
'description' => t('Custom product available for purchase.'),
'revision' => '1',
),
);
}
Currently autosku module does not provide any way to add sku tokens to a product created like above. I can write a patch if pointed to the right direction.
Comments
Comment #1
rbayliss CreditAttribution: rbayliss commentedThere are now two ways to do this. You can either define the autosku settings in your hook_commerce_product_type_info(), like so:
The recommended way to do it though, is to use hook_default_commerce_autosku_patterns() (this is just using CTools export api). Here's an example of that:
Just one note if you're going to use the second method - I just added support for that today, so you'll need the latest dev version.
Comment #2
rbayliss CreditAttribution: rbayliss commentedComment #4
cocoshogo CreditAttribution: cocoshogo commentedDoes this still work? Can I just add #1 (second suggestion) to my themes template.php ?