lundi 20 juin 2016

woocommerce customization for cart update page

I had work on the woocommerce. I am new in woocommerce. I used the http://ift.tt/28JmSyT for showing the product product_meta. I want to update the product meta/meta_deta in the cart page when the user change the quantity for the product meta /meta_data.

     Array
    (
      [product_meta] => Array
           (
    [meta_data] => Array
        (
        )

    [var_price] => 0
    [fixed_price] => 
    [file_cost] => 
    [price_matrix] => 
    [_product_attached_files] => 
)

     [product_id] => 9
    [variation_id] => 0
    [variation] => Array
    (
     )

 [quantity] => 3
 [line_total] => 15
 [line_tax] => 0
 [line_subtotal] => 15
 [line_subtotal_tax] => 0
 [line_tax_data] => Array
   (
    [total] => Array
        (
        )

    [subtotal] => Array
        (
        )

)

    [data] => WC_Product_Simple Object
      (
      [id] => 9
       [post] => WP_Post Object
        (
            [ID] => 9
            [post_author] => 1
            [post_date] => 2016-06-20 06:04:58
            [post_date_gmt] => 2016-06-20 06:04:58
            [post_content] => 
            [post_title] => test product
            [post_excerpt] => test deone
            [post_status] => publish
            [comment_status] => open
            [ping_status] => closed
            [post_password] => 
            [post_name] => test-product
            [to_ping] => 
            [pinged] => 
            [post_modified] => 2016-06-20 10:07:47
            [post_modified_gmt] => 2016-06-20 10:07:47
            [post_content_filtered] => 
            [post_parent] => 0
            [guid] => http://localhost/woo-com/?post_type=product&p=9
            [menu_order] => 0
            [post_type] => product
            [post_mime_type] => 
            [comment_count] => 0
            [filter] => raw
           )

    [product_type] => simple
    [shipping_class:protected] => 
    [shipping_class_id:protected] => 0
    [total_stock] => 
    [supports:protected] => Array
        (
            [0] => ajax_add_to_cart
        )

    [price] => 5
    [stock_status] => instock
    [manage_stock] => no
    [tax_status] => taxable
    )
 )

Above is the array of the cart object. I want to update that array when user submit update button. Like I add the meta data in the product_meta.

Please help me.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire