0

I have this object and I need to echo the value of ...attributes->pa_unidaddeventa

WC_Product_Variation Object
(
    [post_type:protected] => product_variation
    [data:protected] => Array
        (
            [attributes] => Array
                (
                    [pa_unidaddeventa] => 11-70cmx100m
                    [pa_manipulacion] => 56-cortadaa62_8cm
                )

...

The variable $product contains the object. I tried with these but not working. It should print out this value: 11-70cmx100m

echo $product->data[1]->attributes[1]->pa_unidaddeventa;

echo $product->data[0]->attributes[0]->pa_unidaddeventa;

Both prints nothing. What is the mistake?

JPashs
  • 13,044
  • 10
  • 42
  • 65

0 Answers0