take the value of array(attribute_pa_seat-cover = back)

Hello I want to take the value of attribute_pa_seat_cover so please help me.
currently I am $values which contains the all the below lists of array. currently I am writing the below code which is display the below details of array.
print_r($values);

Array
    (
        [product_id] => 393
        [variation_id] => 424
        [variation] => Array
            (
                [pa_seat-cover] => back
            )

        [quantity] => 4
        [data] => WC_Product_Variation Object
            (
                [variation_id] => 424
                [parent] => WC_Product_Variable Object
                    (
                        [children] => 
                        [total_stock] => 
                        [id] => 393
                        [post] => WP_Post Object
                            (
                                [ID] => 393
                                [post_author] => 1
                                [post_date] => 2014-02-02 01:13:10
                                [post_date_gmt] => 2014-02-02 01:13:10
                                [post_content] => Please contact in store for information and ordering
                                [post_title] => POSITANO
                                [post_excerpt] => 
                                [post_status] => publish
                                [comment_status] => open
                                [ping_status] => closed
                                [post_password] => 
                                [post_name] => positano
                                [to_ping] => 
                                [pinged] => 
                                [post_modified] => 2014-02-13 13:44:56
                                [post_modified_gmt] => 2014-02-13 13:44:56
                                [post_content_filtered] => 
                                [post_parent] => 0
                                [guid] => http://localhost/thecanvas?post_type=product&p=393
                                [menu_order] => 0
                                [post_type] => product
                                [post_mime_type] => 
                                [comment_count] => 0
                                [filter] => raw
                                [format_content] => 
                            )

                        [product_type] => variable
                    )

                [variation_data] => Array
                    (
                        [attribute_pa_seat-cover] => back
                    )

Related posts

Leave a Reply

1 comment

  1. Can you try this as a final shot ?

    Your [data] => WC_Product_Variation Object is an object , so it should be accessed using the -> operator and the others are just plain arrays.

    print $values['data']->variation_data['attribute_pa_seat-cover'];