Originally posted by **rolinbos** July 30, 2024
Hi,
I set my products through the API. When I set a product variant through code it says everything is fine. But when I look at the control panel couple of things are missing.
Here is a screenshot of what it looks like in CP
![Screenshot 2024-07-30 at 13 49 27](https://github.com/user-attachments/assets/7f134397-3740-4221-a8ce-31faee5cdf6f)
This is the code how I set the product variants:
```
$sc->productVariants([
'variants' => [
['name' => 'Colours', 'values' => ['Red', 'Green', 'Blue']],
['name' => 'Size', 'values' => ['Small', 'Medium']],
],
'options' => [
['key' => 'Red_Small', 'variant' => 'Red Small', 'price' => 2500],
['key' => 'Red_Medium', 'variant' => 'Red Medium', 'price' => 2700],
['key' => 'Green_Small', 'variant' => 'Green Small', 'price' => 2500],
],
]);
```
When I do a dump of the product it shows all the fields.
![Screenshot 2024-07-30 at 13 52 59](https://github.com/user-attachments/assets/3bf5ffa2-445a-4b68-9fb2-1011ce5c4f1b)
How can I solve this to get it also in the CP? I'm using Statamic 5.17.1 & simple commerce 7.4.0
Discussed in https://github.com/duncanmcclean/simple-commerce/discussions/1115