# configurationsSettings

**URL:** <https://forum.shopware.com/t/configurationssettings/102651>\
**Category:** Programmierung\
**Created:** [24. Januar 2024 um 09:01 UTC](https://forum.shopware.com/t/configurationssettings/102651 "2024-01-24T09:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschwarz](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jschwarz](https://forum.shopware.com/u/jschwarz)\
**Post date:** [24. Januar 2024 um 09:01 UTC](https://forum.shopware.com/t/configurationssettings/102651/1 "2024-01-24T09:01:12Z")

</div>

Guten Tag,

ich habe mit PHP dieses Produkt angelegt.

```auto
$parentProductData = [
    "id" => $randomString,
    "name" => "TESTTITEL Stanley/Stella \"" . $aArticle['StyleName'] . "\"",
    "productNumber" => $aArticle['StyleCode'],
    "stock" => $aArticle['Variants'][0]['Stock'], 
    "description" => $description,
    "taxId" => bin2hex($aTax['id']),
    "manufacturerId" => "0e73a062642247e3a634518826e30865",

    "configuratorSettings" => [
        [
            "productId" => $randomString,
            "optionId" => "9a424f702a434b1abfc09740f7a0cbb1",
        ],
        [
            "productId" => $randomString,
            "optionId" => "4c86f2e5047d4715971628d1f5f8d186",
        ],
    ],
    "price" => [
        [
            "currencyId" => bin2hex($aCurrency['id']),
            "gross" => $aArticle['Variants'][0]["Price<10 EUR"]*1.19, // oder ein anderer Wert
            "net" => $aArticle['Variants'][0]["Price<10 EUR"], // oder ein anderer Wert
            "linked" => false
        ]
    ],
    "visibilities" => [
        [
            "productId" => $randomString,
            "salesChannelId" => "d54a310b363f4f3eaf2822c24783e1d9", // Ersetzen Sie dies mit der tatsächlichen Sales Channel-ID
            "visibility" => 30, // 30 bedeutet sichtbar in diesem Verkaufskanal
        ],
    ],
    "categories" => [
        ["id" => $categories[$aArticle['Gender']][$aArticle['CategoryCode']]]
    ],
];

```

Leider kommt wenn ich

```auto
    "configuratorSettings" => [
        [
            "productId" => $randomString,
            "optionId" => "9a424f702a434b1abfc09740f7a0cbb1",
        ],
        [
            "productId" => $randomString,
            "optionId" => "4c86f2e5047d4715971628d1f5f8d186",
        ],
    ],

```

Einfüge dieser Fehler…

```auto
`
object
{1}
errors
[1]
0
{4}
code
:
"1452"
detail
:
"An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`admin_shopware`.`product_configurator_setting`, CONSTRAINT `fk.product_configurator_setting.property_group_option_id` FOREIGN KEY (`property_group_option_id`) REFERENCES `property_group_optio)"
status
:
"500"
title
:
"Internal Server Error"
`

```
