Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Issue with bundled Products › Reply To: Issue with bundled Products
September 27, 2018 at 2:20 pm
#9491
Lievelabels.nl
Participant
After a quick look this function adds meta data to the cart item:
function ppom_woocommerce_add_cart_item_data($cart, $product_id) {
if( ! isset($_POST['ppom']) ) return $cart;
if( ! $selected_meta_id = ppom_has_product_meta( $product_id ) ) {
return $cart;
}
$ppom_settings = PPOM() -> get_product_meta ( $selected_meta_id );
if( empty($ppom_settings) ) return $cart;
// PPOM also saving cropped images under this filter.
$ppom_posted_fields = apply_filters('ppom_add_cart_item_data', $_POST['ppom'], $_POST);
$cart['ppom'] = $ppom_posted_fields;
// ppom_pa($_POST); exit;
return $cart;
}
So if we implement tha same here?
if ( class_exists('WC_Bundles') && wc_pb_is_bundled_cart_item( $cart_item )) {
return $item_meta;
}
@nmedia, its a very complex plugin, it adds also extra data like you, but the best thing is to check if the cart item is a bundled item by using the functions the have available: wc_pb_is_bundled_cart_item($cart_item)
For more information:
- This reply was modified 6 years ago by Lievelabels.nl.