<?php
declare(strict_types=1);
namespace WbfkExtensions;
use Doctrine\DBAL\Connection;
use Exception;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Shopware\Core\Kernel;
use Shopware\Core\System\CustomField\CustomFieldTypes;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use WbfkExtensions\DependencyInjection\WbfkExtensionsExtension;
use WbfkExtensions\Install\PartnerMediaFolder;
use WbfkExtensions\Lifecycle\CustomFieldsInvoiceData;
use WbfkExtensions\Lifecycle\MailLifecycle;
class WbfkExtensions extends Plugin
{
public const PARTIAL_CHOOSER_CONTENT = 'wbfk_footer_cms_partial_chooser_content';
public function getTemplatePriority(): int
{
return 5000;
}
public function createContainerExtension(): WbfkExtensionsExtension
{
return new WbfkExtensionsExtension();
}
public function build(ContainerBuilder $container): void
{
$this->buildConfig($container);
parent::build($container);
}
private function buildConfig(ContainerBuilder $container): void
{
$locator = new FileLocator('Resources/config');
$resolver = new LoaderResolver([
new YamlFileLoader($container, $locator),
new GlobFileLoader($container, $locator),
]);
$configLoader = new DelegatingLoader($resolver);
$confDir = $this->getPath().'/Resources/config';
$configLoader->load($confDir.'/{packages}/*'.Kernel::CONFIG_EXTS, 'glob');
}
/**
* @param ActivateContext $activateContext
*/
public function activate(ActivateContext $activateContext): void
{
parent::activate($activateContext);
PartnerMediaFolder::activate($activateContext, $this->container);
/** @var EntityRepositoryInterface $customFieldSetRepository */
$customFieldSetRepository = $this->container->get(
'custom_field_set.repository'
);
$fieldSets = $this->getCustomFieldSets();
foreach ($fieldSets as $fieldSet) {
try {
$customFieldSetRepository->upsert(
[$fieldSet],
$activateContext->getContext()
);
} catch (Exception $exception) {
var_dump($exception->getMessage());
}
}
CustomFieldsInvoiceData::upsert($customFieldSetRepository, $activateContext->getContext());
}
/**
* @param UpdateContext $updateContext
*/
public function update(UpdateContext $updateContext): void
{
parent::update($updateContext);
/** @var EntityRepositoryInterface $customFieldSetRepository */
$customFieldSetRepository = $this->container->get(
'custom_field_set.repository'
);
$fieldSets = $this->getCustomFieldSets();
foreach ($fieldSets as $fieldSet) {
try {
$customFieldSetRepository->upsert(
[$fieldSet],
$updateContext->getContext()
);
} catch (Exception $exception) {
var_dump($exception->getMessage());
}
}
CustomFieldsInvoiceData::upsert($customFieldSetRepository, $updateContext->getContext());
}
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
PartnerMediaFolder::uninstall($uninstallContext, $this->container);
if ($uninstallContext->keepUserData()) {
return;
}
/** @var Connection $connection */
$connection = $this->container->get(Connection::class);
$mailLifecycle = new MailLifecycle($connection);
$mailLifecycle->delete();
/** @var EntityRepositoryInterface $customFieldSetRepository */
$customFieldSetRepository = $this->container->get(
'custom_field_set.repository'
);
CustomFieldsInvoiceData::delete($customFieldSetRepository, $uninstallContext->getContext());
}
/**
* @return array
*/
private function getCustomFieldSets(): array
{
$fieldsets = [];
/* Fieldset for categories */
$fieldsets[] = [
'id' => 'efd76a2fe19d451293d613051a9055ce',
'name' => 'wbfk_cms_parial_selector',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'CMS Partial Selector',
'de-DE' => 'CMS Partial Auswahl',
],
],
'customFields' => [
[
'id' => '4dd5a2970f354a948a6696ac611398cd',
'name' => 'm24_footer_partial_headline',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => 1000,
'label' => [
'en-GB' => 'Headline for the CMS partial in the footer',
'de-DE' => 'Headline für das CMS Partial im Footer',
],
],
],
[
'id' => 'f703ed9862a7481f9b581e3104d50e0e',
'name' => $this::PARTIAL_CHOOSER_CONTENT,
'type' => CustomFieldTypes::ENTITY,
'config' => [
'customFieldPosition' => 10000,
'required' => false,
'componentName' => 'sw-entity-single-select-wbfk-partial',
'entity' => 'cms_page',
'label' => [
'en-GB' => 'CMS partial in the footer area',
'de-DE' => 'CMS Partial im Footer',
],
],
],
[
'id' => 'a6ab954fb5944711b31f46d00438aeaa',
'name' => 'wbfk_feed_delivery_country',
'type' => CustomFieldTypes::ENTITY,
'config' => [
'customFieldPosition' => 10020,
'required' => false,
'componentName' => 'sw-entity-single-select-wbfk-partial',
'entity' => 'country',
'label' => [
'en-GB' => 'Country for calulating delivery times in this feed.',
'de-DE' => 'Land für die Berechnung der Lieferzeiten in diesem Feed.',
],
],
],
],
'relations' => [
[
'id' => '6b71f634b1544877beae1bd282e4a544',
'entityName' => 'sales_channel',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => '1292346c3ed642059bc1fbe1848fcb17',
'name' => 'wbfk_further_technical_data',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - Further techn. data',
'de-DE' => 'M24 - Weitere techn. Daten',
],
],
'customFields' => [
[
'id' => 'c558c7feda32498e85e4c078730f704c',
'name' => 'wbfk_product_housing_dimension',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Housing dimension in inches',
'de-DE' => 'Gehäusemaß in Zoll',
],
],
],
[
'id' => '78c265afa8274d38a3f5deaab413a04b',
'name' => 'wbfk_product_load_capacity',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Load capacity in kg.',
'de-DE' => 'Belastbarkeit in kg.',
],
],
],
[
'id' => '7e451487ecb2434f9d9eb47bf392b24c',
'name' => 'wbfk_product_power_consumption',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Electricity consumption in kwh/year',
'de-DE' => 'Stromverbrauch in kwh/Jahr',
],
],
],
[
'id' => '6d4a28c016cc4fb49f6c141dabcc64ab',
'name' => 'wbfk_product_range',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Range in m',
'de-DE' => 'Reichweite in m',
],
],
],
[
'id' => '8a5fd5c785984a179b23111e692d1f70',
'name' => 'wbfk_product_microphone',
'type' => CustomFieldTypes::TEXT,
'config' => [
'componentName' => 'sw-textarea-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Microphone',
'de-DE' => 'Mikrofon',
],
],
],
[
'id' => 'd7c634fd91ed478cad66b5805e641a5a',
'name' => 'wbfk_product_height_adjustment',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Height adjustment in mm',
'de-DE' => 'Höhenverstellung in mm',
],
],
],
[
'id' => 'ef59b5500894485bbcebcb9ed2bd342d',
'name' => 'wbfk_product_weight',
'type' => CustomFieldTypes::FLOAT,
'config' => [
'customFieldPosition' => 3000,
'required' => true,
'label' => [
'en-GB' => 'Product weight in kg',
'de-DE' => 'Produktgewicht in kg',
],
],
],
[
'id' => '20d8c99765f14f5da4b94fd7893ab1d0',
'name' => 'wbfk_product_scope_of_delivery',
'type' => CustomFieldTypes::TEXT,
'config' => [
'componentName' => 'sw-textarea-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Scope of delivery',
'de-DE' => 'Lieferumfang',
],
],
],
[
'id' => '2d0bf50da0134dd9a7649234bd3b3994',
'name' => 'wbfk_product_measurements',
'type' => CustomFieldTypes::TEXT,
'config' => [
'componentName' => 'sw-textarea-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Dimensions W x H x D',
'de-DE' => 'Abmessungen B x H x T',
],
],
],
[
'id' => 'e0cdb5755def44af8cc5037329d2acb4',
'name' => 'wbfk_product_brightness_guide',
'type' => CustomFieldTypes::TEXT,
'config' => [
'componentName' => 'sw-textarea-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Brightness guide',
'de-DE' => 'Helligkeit Kaufberater',
],
],
],
[
'id' => 'b7ba6db3e38a40308ac853ebaf17d8d3',
'name' => 'wbfk_product_not_for_private',
'type' => CustomFieldTypes::BOOL,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Only for commercial customers',
'de-DE' => 'Nur für Firmenkunden',
],
],
],
[
'id' => '46c19d08cd0e4912bbfd1d79ef11dd07',
'name' => 'wbfk_product_field_of_application',
'type' => CustomFieldTypes::TEXT,
'config' => [
'componentName' => 'sw-textarea-field',
'customFieldType' => 'textarea',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Field of application',
'de-DE' => 'Anwendungsgebiet',
],
],
],
[
'id' => '02df420e210d42e4a07d05b668b3e079',
'name' => 'wbfk_product_energy_efficiency',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'EEK class',
'de-DE' => 'EEK-Klasse',
],
],
],
[
'id' => '7386018c47ad403ea7906343f14349d9',
'name' => 'wbfk_product_special_features',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Special features',
'de-DE' => 'Besonderheiten',
],
],
],
[
'id' => 'ae65b48fda294b64af9822c3f15214ff',
'name' => 'wbfk_product_inputs',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Inputs',
'de-DE' => 'Eingänge',
],
],
],
[
'id' => '73d1da6d99774e0188c2522bdef8cef7',
'name' => 'wbfk_product_supported_video_formats',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Supported video formats',
'de-DE' => 'Unterstützte Videoformate',
],
],
],
[
'id' => 'a71805ad8ace47cabdb308415c665084',
'name' => 'wbfk_product_certifications',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Certifications',
'de-DE' => 'Zertifikate',
],
],
],
[
'id' => '9f83eb4c30b9473cb4b5009eb3ff7ca2',
'name' => 'wbfk_product_connections',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Connections',
'de-DE' => 'Konnektivität',
],
],
],
[
'id' => '57c294c2467047bb9523ef1d58dd7b2c',
'name' => 'wbfk_product_notices',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Notices',
'de-DE' => 'Hinweise',
],
],
],
[
'id' => '5aefd6a397f7481facd49fef68553e1f',
'name' => 'wbfk_product_microsoft_teams_button',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Microsoft Teams button',
'de-DE' => 'Microsoft Teams Taste',
],
],
],
[
'id' => '828d9ab76c0c4298841cc70c30fa604c',
'name' => 'wbfk_product_security',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Security',
'de-DE' => 'Sicherheit',
],
],
],
[
'id' => '1e3b6236df2d4646a3f40163b6cc4ba0',
'name' => 'wbfk_product_minimum_contract_period',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Minimum contract period',
'de-DE' => 'Mindestvertragslaufzeit',
],
],
],
],
'relations' => [
[
'id' => '1ab60e265e6f42a6a2e4923ea117760c',
'entityName' => 'product',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => '158deef417c84656a63fc9d10cb56c34',
'name' => 'wbfk_product_data',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - add. data',
'de-DE' => 'M24 - zus. Daten',
],
],
'customFields' => [
[
'id' => '26e1197d4f864b53b59530fb7375a4be',
'name' => 'wbfk_product_sennheiser_id',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Sennheiser ID',
'de-DE' => 'Sennheiser ID',
],
],
],
[
'id' => '256deef417c84656a63fc9d10cb57c37',
'name' => 'wbfk_product_terms_and_conditions_file',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldType' => CustomFieldTypes::MEDIA,
'customFieldPosition' => $position++,
'componentName' => 'sw-media-field',
'label' => [
'en-GB' => 'Terms and conditions file',
'de-DE' => 'AGB-Datei',
],
],
],
[
'id' => 'fd8289f4db5e44b9af3c33ed71f118b3',
'name' => 'wbfk_product_energylabel_file',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldType' => CustomFieldTypes::MEDIA,
'customFieldPosition' => $position++,
'componentName' => 'sw-media-field',
'label' => [
'en-GB' => 'EEK label',
'de-DE' => 'EEK-Label',
],
],
],
[
'id' => '9d91bd6724694e8696a1514b9c340b86',
'name' => 'wbfk_product_energylabel_datasheet_file',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldType' => CustomFieldTypes::MEDIA,
'customFieldPosition' => $position++,
'componentName' => 'sw-media-field',
'label' => [
'en-GB' => 'EEK datasheet',
'de-DE' => 'EEK-Datenblatt',
],
],
],
[
'id' => '3fdeb9bbf6214e249c49168106888f83',
'name' => 'wbfk_product_only_on_request',
'type' => CustomFieldTypes::BOOL,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Product available only on request',
'de-DE' => 'Produkt nur auf Anfrage verfügbar',
],
],
],
],
'relations' => [
[
'id' => '1ac61e275e6f43a6a2e3923ea117761d',
'entityName' => 'product',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => 'd62717d4547149a39ee25a8ac067672b',
'name' => 'wbfk_product_data_feeds',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - Feed data',
'de-DE' => 'M24 - Feeddaten',
],
],
'customFields' => [
[
'id' => 'caf8dd9d6a684ca4ad2f3c7519787118',
'name' => 'idealo_puretext_description',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Idealo: Product description (only text)',
'de-DE' => 'Idealo: Produktbeschreibung (nur Text)',
],
'helpText' => [
'en-GB' => 'With this field you can store your own article description for Idealo. No HTML allowed!',
'de-DE' => 'Mit diesem Feld können Sie für Idealo eine eigene Artikelbeschreibung hinterlegen. Kein HTML erlaubt!',
],
],
],
],
'relations' => [
[
'id' => '4c772afcbb7146659a0599be0d72f1f7',
'entityName' => 'product',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => 'c2c930bb10c54637ae102a736176365f',
'name' => 'wbfk_product_data_internal',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - internal',
'de-DE' => 'M24 - intern',
],
],
'customFields' => [
[
'id' => '7fc0d7eb9f624de09513e0902146bfbe',
'name' => 'wbfk_product_author',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Author',
'de-DE' => 'Autor',
],
],
],
[
'id' => '1f3b942c6d6c4f39aad6ec7f109023c6',
'name' => 'wbfk_product_author_info',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Info article editor',
'de-DE' => 'Info Artikeleinsteller',
],
],
],
[
'id' => '4ba665b9850b4246901c18c02b6e07af',
'name' => 'wbfk_product_buy_price',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price',
'de-DE' => 'Einkaufspreis',
],
],
],
[
'id' => 'f871975c8db948c592d1981ac47d3e2e',
'name' => 'wbfk_product_buy_price_without_project',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price without project',
'de-DE' => 'Einkaufspreis ohne eigenes Projekt',
],
],
],
[
'id' => 'b64b93d8b68f4c04a71359351d8c6258',
'name' => 'wbfk_product_buy_price_subscription_24_months',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price subscription 24 months',
'de-DE' => 'Einkaufspreis Abo auf 24 Monate',
],
],
],
[
'id' => 'bfe48efbc51845f3924f10198baae0f9',
'name' => 'wbfk_product_buy_price_subscription_12_months',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price subscription 12 months',
'de-DE' => 'Einkaufspreis Abo auf 12 Monate',
],
],
],
[
'id' => 'a490067d86ae4abd8ad3449c8ab9e90c',
'name' => 'wbfk_product_buy_price_schools',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price schools',
'de-DE' => 'Einkaufspreis Schulen',
],
],
],
[
'id' => 'd5c93e6374e545a5acc3308e35e7d6bb',
'name' => 'wbfk_product_buy_price_other',
'type' => CustomFieldTypes::TEXT,
'config' => [
'type' => CustomFieldTypes::TEXT,
'componentName' => 'sw-field',
'customFieldType' => 'textEditor',
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Buy price other info',
'de-DE' => 'Sonstige Hinweise für EK',
],
],
],
[
'id' => '3c6a05ee741c4e2dba279d9326a68a3e',
'name' => 'wbfk_product_shipping_goods',
'type' => CustomFieldTypes::BOOL,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Shipping goods',
'de-DE' => 'Speditionsware',
],
],
],
[
'id' => '8d087bb680334011900870bdff37a2e9',
'name' => 'wbfk_product_bulky_goods',
'type' => CustomFieldTypes::BOOL,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Bulky goods',
'de-DE' => 'Sperrgut',
],
],
],
[
'id' => '1e5624f80f854bbe8375abc1f9aa2c82',
'name' => 'wbfk_product_stock_weighed',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Stock weighed',
'de-DE' => 'Lager gewogen',
],
],
],
[
'id' => 'f8cc821b1fbe84b24375aa2e569a5f80',
'name' => 'wbfk_new_product_exported_jtl',
'type' => CustomFieldTypes::BOOL,
'config' => [
'customFieldPosition' => $position,
'label' => [
'en-GB' => 'Product has been eported to JTL',
'de-DE' => 'Produkt wurde zu JTL exportiert',
],
],
],
],
'relations' => [
[
'id' => 'e18b8619d8844121bd88c7ca8d0cba92',
'entityName' => 'product',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => 'e060335a84d8490db198ef6f24a6a1a8',
'name' => 'wbfk_customer_data',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - Customer Data',
'de-DE' => 'M24 - Kundendaten',
],
],
'customFields' => [
[
'id' => '9fc0d7fb9f624de09513e0902186bfbf',
'name' => 'wbfk_customer_trade_license',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldType' => CustomFieldTypes::MEDIA,
'customFieldPosition' => $position++,
'componentName' => 'sw-media-field',
'label' => [
'en-GB' => 'Trade license',
'de-DE' => 'Gewerbeschein',
],
],
],
],
'relations' => [
[
'id' => 'f48b8656d8844121bd88c7ca8d8cba78',
'entityName' => 'customer',
],
],
];
$position = 10000;
$fieldsets[] = [
'id' => '62150d4919d140d4bfaff184f315c494',
'name' => 'wbfk_property_group_configuration',
'active' => true,
'global' => false,
'config' => [
'translated' => true,
'label' => [
'en-GB' => 'M24 - Property Group Configuration',
'de-DE' => 'M24 - Eigenschaften Gruppen Konfiguration',
],
],
'customFields' => [
[
'id' => '5f256e9e4a584a188754e39f3ef7cadc',
'name' => 'wbfk_property_group_configuration_display_type',
'type' => CustomFieldTypes::SELECT,
'config' => [
'customFieldType' => CustomFieldTypes::SELECT,
'customFieldPosition' => $position++,
'componentName' => 'sw-single-select',
'options' => [
[
'value' => 'one-value-min-max-selector',
'label' => [
'en-GB' => 'One Value, Min / Max Selector',
'de-DE' => 'One Value, Min / Max Selector',
],
],
[
'value' => 'two-values-two-min-selector',
'label' => [
'en-GB' => 'Two Values, two min Selector',
'de-DE' => 'Two Values, two min Selector',
],
],
[
'value' => 'one-value-min-selector',
'label' => [
'en-GB' => 'One Value, Min Selector',
'de-DE' => 'One Value, Min Selector',
],
],
[
'value' => 'one-value-max-selector',
'label' => [
'en-GB' => 'One Value, Max Selector',
'de-DE' => 'One Value, Max Selector',
],
],
[
'value' => 'range-single-value-selector',
'label' => [
'en-GB' => 'Range, Single Value Selector',
'de-DE' => 'Range, Single Value Selector',
],
],
// Deactivated till decision on how to proceed when no property is matched with slider selection, ideally this should empty result but shopware currently shows full result set.
// [
// 'value' => 'range-contain-range-selector',
// 'label' => [
// 'en-GB' => 'Range, Contain Range-Selector',
// 'de-DE' => 'Range, Contain Range-Selector',
// ],
// ],
],
'label' => [
'en-GB' => 'Filter Display Type',
'de-DE' => 'Filter Anzeige Typ',
],
],
],
[
'id' => 'e9ef0aa0fc2c401bb43bcccd2450a2e5',
'name' => 'wbfk_property_group_configuration_value_type',
'type' => CustomFieldTypes::SELECT,
'config' => [
'customFieldType' => CustomFieldTypes::SELECT,
'customFieldPosition' => $position++,
'componentName' => 'sw-single-select',
'options' => [
[
'value' => 'integer',
'label' => [
'en-GB' => 'Integer',
'de-DE' => 'Integer',
],
],
[
'value' => 'float',
'label' => [
'en-GB' => 'Float',
'de-DE' => 'Float',
],
],
],
'label' => [
'en-GB' => 'Filter Value Type',
'de-DE' => 'Filter Wert Typ',
],
'helpText' => [
'en-GB' => 'Used when the filter is a slider',
'de-DE' => 'Wird verwendet, wenn der Filter ein Slider ist',
],
],
],
[
'id' => '1402140e9ba4419997a9b9e8179eabdb',
'name' => 'wbfk_property_group_configuration_value_suffix',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Filter Value Suffix',
'de-DE' => 'Filter Wert Suffix',
],
'helpText' => [
'en-GB' => 'Used when the filter is a single slider',
'de-DE' => 'Used when the filter is a single slider',
],
],
],
[
'id' => 'ecd887dc83164f03a3d6374ca41a7d09',
'name' => 'wbfk_property_group_configuration_first_dimension_title',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'First Dimension Title',
'de-DE' => 'Titel der ersten Dimension',
],
'helpText' => [
'en-GB' => 'Used when the filter is a two dimensional slider',
'de-DE' => 'Wird verwendet, wenn der Filter ein zweidimensionaler Slider ist',
],
],
],
[
'id' => 'dce6434a9c074fa9b102cfb1697a069a',
'name' => 'wbfk_property_group_configuration_second_dimension_title',
'type' => CustomFieldTypes::TEXT,
'config' => [
'customFieldPosition' => $position++,
'label' => [
'en-GB' => 'Second Dimension Title',
'de-DE' => 'Titel der zweiten Dimension',
],
'helpText' => [
'en-GB' => 'Used when the filter is a two dimensional slider',
'de-DE' => 'Wird verwendet, wenn der Filter ein zweidimensionaler Slider ist',
],
],
],
],
'relations' => [
[
'id' => '514b0ad866dc483eaa35982568322a2c',
'entityName' => 'property_group',
],
],
];
return $fieldsets;
}
}