Hi Mark,
good example but I have tried to harden it a little bit so here is my product data from a PHP script:
[
'sku' => 'test2',
'name' => 'Big TV',
'description' => 'ma tEsEt descr',
'price' => 15000, // in cents
'sale_price' => 129900,
'sale_price_from' => '2019-08-07 18:11:31+02:00',
'sale_price_until' => '2019-10-01 01:00:00+02:00',
'stock' => 14,
'weight' => 15.50,
'weight_unit' => 'kg',
'length_unit' => 'cm',
'image' => '/assets/components/bob/img/logo.svg',
'properties' => serialize([
'product_with_alcohol' => 0,
'extra_details' => [
'image_alt_0' => 'abc',
'image_1' => '/assets/products/images/ast.jpg',
'image_alt_1' => '#$%^',
'image_2' => '/assets/products/images/xpink.jpg',
'image_alt_2' => '12',
'image_3' => '/assets/products/images/hat.jpg',
'image_alt_3' => '',
'image_4' => '',
'image_alt_4' => '',
'image_5' => '',
'image_alt_5' => '',
'video_url' => '',
'youtube_id' => '',
]
]),
'width' => 12.50,
'height' => 11.50,
'depth' => 10.50,
],
but you know it does not update width, height, depth, properties fields. In your script I have found a very important comment “// This assumes the source data has the right keys” and I was taking the fields from the Mysql query: DESCRIBE modx_commerce_product
which has assured me I was on the right way.
Do you know what I was doing wrong, please?