Situation: A Woocommerce product object typically holds an array dimensions
with raw x y z values.
$product = [
'dimensions' => [
'length' => 1,
'width' => 1,
'height' => 1
],
'dimensions_html' => '1 x 1 x 1 cm',
...
Using "Additional custom dimensions for products in Woocommerce" answer code, I created 3 new custom dimensions (depth, diameter, seat-height)…
Problem: I want to add these properties to the product class so they are directly available everywhere like:
$product = [
'dimensions' => [
'length' => 1,
'width' => 1,
'height' => 1,
'depth' => 1,
'diameter' => 1,
'seat-height' => 1
],
'dimensions_html' => '1 x 1 x 1 x 1 x 1 x 1 cm',
...
How can this be done?