Advertisement
arie_cristianD

fix cart issue woocommerce

Mar 26th, 2024
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. add_filter( 'woocommerce_get_item_data', 'filter_extra_data_display', 99, 3 );
  2.  
  3. function filter_extra_data_display( $item_data, $cart_item ) {
  4.     foreach ( $item_data as $key => $data ) {
  5.         if ( ! array_key_exists( 'display', $data ) && $data['hidden'] !== 1 && is_array( $data['value'] ) ) {
  6.             $item_data[ $key ]['hidden'] = 1;
  7.         }
  8.     }
  9.     return $item_data;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement