Created
December 6, 2018 12:04
-
-
Save plugin-republic/525acbfc37d91e97091c6823229a1aa3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function prefix_update_existing_cart_item_meta() { | |
$cart = WC()->cart->cart_contents; | |
foreach( $cart as $cart_item_id=>$cart_item ) { | |
$cart_item['new_meta_data'] = 'Your stuff goes here'; | |
WC()->cart->cart_contents[$cart_item_id] = $cart_item; | |
} | |
WC()->cart->set_session(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @CUBICinfinity i will give this a try and update back here for feedback if any... stay awesome...