modules/acm_sku/src/Plugin/AcquiaCommerce/SKUType/Configurable.php
protected function extractConfigurableOptions($attribute_set, array $configurable_options) {
    /** @var \Drupal\acm_sku\CartFormHelper $helper */
    $helper = \Drupal::service('acm_sku.cart_form_helper');

    // Load existing options.
    $existing_options = $helper->getConfigurableAttributeWeights($attribute_set);

    // Transform incoming options.
    foreach ($configurable_options as $configurable) {
      $existing_options[$configurable['code']] = $configurable['position'];
    }

    // Save options.
    $helper->setConfigurableAttributeWeights($attribute_set, $existing_options);
  }
protected function extractConfigurableOptions($attribute_set, array $configurable_options) {
    /** @var \Drupal\acm_sku\CartFormHelper $helper */
    $helper = \Drupal::service('acm_sku.cart_form_helper');

    // Load existing options.
    $existing_options = $helper->getConfigurableAttributeWeights($attribute_set);

    // Transform incoming options.
    foreach ($configurable_options as $configurable) {
      $existing_options[$configurable['code']] = $configurable['position'];
    }

    // Save options.
    $helper->setConfigurableAttributeWeights($attribute_set, $existing_options);
  }
protected function extractConfigurableOptions ( $ attribute_set , array $ configurable_options ) { /** @var \Drupal\acm_sku\CartFormHelper $helper */ $ helper = \ Drupal :: service ( 'acm_sku.cart_form_helper' ) ; // Load existing options. $ existing_options = $ helper -> getConfigurableAttributeWeights ( $ attribute_set ) ; // Transform incoming options. foreach ( $ configurable_options as $ configurable ) { $ existing_options [ $ configurable [ 'code' ] ] = $ configurable [ 'position' ] ; } // Save options. $ helper -> setConfigurableAttributeWeights ( $ attribute_set , $ existing_options ) ; }
Extract configurable options.

Extract new configurable options during import and store them.

@param string $attribute_set
Attribute set.
@param array $configurable_options
Array with configurable options.
Extract configurable options .