You are here

public function CommerceSmartImporerService::getConfig in Commerce Smart Importer 8

Returns config based on default and systems.

Purpose of this is for smart importer to work without config.

5 calls to CommerceSmartImporerService::getConfig()
CommerceSmartImporerService::createFile in src/Plugin/CommerceSmartImporerService.php
Creates image value based on field settings.
CommerceSmartImporerService::createNewProduct in src/Plugin/CommerceSmartImporerService.php
Creates product.
CommerceSmartImporerService::generateSku in src/Plugin/CommerceSmartImporerService.php
Generates new sku.
CommerceSmartImporerService::getExcludedFieldNames in src/Plugin/CommerceSmartImporerService.php
Helper function for getFieldDefinition, returns excluded fields.
CommerceSmartImporerService::getFieldDefinition in src/Plugin/CommerceSmartImporerService.php
Formats field definition for given product and variation type.

File

src/Plugin/CommerceSmartImporerService.php, line 1852
Main Commerce Smart Importer Service.

Class

CommerceSmartImporerService
This is main Commerce Smart Importer Service.

Namespace

Drupal\commerce_smart_importer\Plugin

Code

public function getConfig() {
  $config = $this
    ->config('commerce_smart_importer.settings')
    ->getRawData();
  $parser = new Parser();
  if (is_file(drupal_get_path('module', 'commerce_smart_importer') . '/config/install/commerce_smart_importer.settings.yml')) {
    $default_config = $parser
      ->parseFile(drupal_get_path('module', 'commerce_smart_importer') . '/config/install/commerce_smart_importer.settings.yml');
  }
  else {
    return $config;
  }
  foreach ($default_config as $key => $value) {
    if (!isset($config[$key])) {
      $config[$key] = $value;
    }
  }
  return $config;
}