woothemes/woocommerce — Issue #522: Problem adding custom cart item meta
Author: dominic-p
Created: 2012-01-21 19:58:45+00:00
State: open

Hi. I'm seeing some strange behavior with the cart item meta functionality. In my plugin, I'm hooking in to the `'woocommerce_add_cart_item_data'` filter and adding some custom meta data to products when they are added to the cart. If I look at the contents of the `$cart_contents` class property during the add to cart operation I can see that my custom data has been successfully merged with the rest of the cart data array.

The problem comes on the cart display page. The custom data is totally gone when I look at the output of `$woocommerce->cart->get_cart()` on the cart page. Is some bug loosing the data, or is something wrong with my program flow? Apologies if this is user error, but the behavior seems strange to me, so I thought I'd let you guys know. Thanks.