Title says it all. We're using the default product type provided by Commerce, and it has no autosku configuration of course.
So, commerce_kickstart_lite_product (or whatever we rename it to) should have some code in hook_install() that configures autosku correctly.

Comments

GuGuss’s picture

Assigned: Unassigned » theo_
GuGuss’s picture

Priority: Normal » Major
theo_’s picture

Status: Active » Needs review

AutoSKU configuration for 'product' product type added.

https://code.drupalcommerce.org/206

bojanz’s picture

Status: Needs review » Fixed

Merged.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ericmulder1980’s picture

Assigned: theo_ » Unassigned
Status: Closed (fixed) » Active

The result of this fix is that the autosku configuration for the default product type 'product' cannot be changed. Why would you hardcode something like a field configuration into hook_commerce_product_type_info_alter()?

I have been checking database tables and different parts of code just to find out that it is impossible for me to change this setting trough the config. If this hook is needed for the install profile than at least make it possible to override this in the product type edit form.

Change it to something like this?

/**
 * Implements hook_commerce_product_type_info_alter().
 */
function commerce_kickstart_lite_product_commerce_product_type_info_alter(&$product_types) {
<del>  if (isset($product_types['product'])) {</del>
  if (isset($product_types['product']) && !isset($product_types['product']['autosku'])) {
    $product_types['product']['autosku'] = array(
      'product_type' => 'product',
      'pattern' => '[commerce-product:title]',
      'advanced' => array(
        'update_existing' => 0,
        'hide_sku' => 1,
        'case' => 'uppercase',
      ),
    );
  }
}
bojanz’s picture

Yes, that's wrong.
I will be removing AutoSKU completely (as well as size and color attributes) from the no demo store product module, so that code will go away in a few hours.

ericmulder1980’s picture

Super! thank you very much for the quick reply. And sorry again about the unsolicited PM on IRC.

bojanz’s picture

Status: Active » Closed (fixed)

Removed the offending code in https://code.drupalcommerce.org/#/c/426/.