add_filter('wpo_update_cart_cart_item_meta', function ($cart_item_meta, $item) {
  return array_merge($cart_item_meta, array(
    'tmpost_data' => isset($item['tmpost_data']) ? $item['tmpost_data'] : null,
  ));
}, 10, 2);

add_filter('wpo_update_cart_loaded_product', function ($loaded_product, $item) {
  return array_merge($loaded_product, array(
    'tmpost_data'         => isset($item['tmpost_data']) ? $item['tmpost_data'] : null,
    'readonly_price'       => isset($item['tm_epo_product_price_with_options']) ? $item['tm_epo_product_price_with_options'] : null,
    'readonly_custom_meta_fields_html' => isset($item['tmcartepo']) ? wc_get_formatted_cart_item_data($item) : '',
  ));
}, 10, 2);

add_filter('wpo_get_item_by_product', function ($product, $cart_item_data) {
  return array_merge($product, array(
    'tmpost_data' => isset($cart_item_data['tmpost_data']) ? $cart_item_data['tmpost_data'] : null,
  ));
}, 10, 2);

add_filter('wpo_cart_item_is_price_readonly', function ($is_readonly, $cart_item_data) {
  return isset($cart_item_data['tmpost_data']) && $cart_item_data['tmpost_data'] ? true : $is_readonly;
}, 10, 2);

add_filter('woocommerce_add_cart_item_data', function ($cart_item_data, $product_id) {
  if ( isset( $cart_item_data['tmpost_data'] ) && function_exists('TM_EPO') ) {
    return TM_EPO()->tm_add_cart_item_data( $cart_item_data, $product_id, $cart_item_data['tmpost_data'] );
  }
  return $cart_item_data;
}, 70, 2);