Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Issue with bundled Products › Reply To: Issue with bundled Products
September 26, 2018 at 1:03 pm
#9433
Participant
yes… I have found the solution. I had to change a function in:
woocommerce-product-addon\inc\woocommerce.php
find function on line 473:
function ppom_woocommerce_add_item_meta($item_meta, $cart_item) {
add after line 475:
if( ! isset($cart_item['ppom']['fields']) ) return $item_meta;
added content:
if ( class_exists('WC_Bundles') && wc_pb_is_bundled_cart_item( $cart_item )) {
return $item_meta;
}
so final result is:
function ppom_woocommerce_add_item_meta($item_meta, $cart_item) {
if( ! isset($cart_item['ppom']['fields']) ) return $item_meta;
if ( class_exists('WC_Bundles') && wc_pb_is_bundled_cart_item( $cart_item )) {
return $item_meta;
}
$ppom_meta = ppom_make_meta_data( $cart_item );
// var_dump($ppom_meta);
foreach( $ppom_meta as $key => $meta ) {
$hidden = isset($meta['hidden']) ? $meta['hidden'] : false;
$display = isset($meta['display']) ? $meta['display'] : $meta['value'];
if( $key == 'ppom_has_quantities' ) $hidden = true;
// if( $key == 'ppom_has_files' ) $hidden = true;
if( isset( $meta['name']) ) {
$meta_val = $meta['value'];
if( apply_filters('ppom_show_option_price_cart', false) && isset($meta['price']) ) {
$meta_val .=' ('.wc_price($meta['price']).')';
}
$meta_key = stripslashes($meta['name']);
// WPML
$meta_key = ppom_wpml_translate($meta_key, 'PPOM');
$item_meta[] = array('name' => wp_strip_all_tags($meta_key), 'value' => $meta_val, 'hidden' => $hidden, 'display'=>$display);
} else {
$item_meta[] = array('name' => ($key), 'value' => $meta, 'hidden' => $hidden, 'display'=>$display);
}
}
return $item_meta;
}
Hopefully N-Media will add it permanently!
Good luck.
-
This reply was modified 6 years, 4 months ago by
Lievelabels.nl.