title: How to override the function wc_get_formatted_cart_item_data in wc-template-functions.php?
body: <p>Inside my cart I print the variation size (eg. size: 42 ) and I want to change to output by adding an additional size attribute (eg. size: 42 - US7 ) --> I wrote a function based on a custom post type field, that adds the size attribute.</p>
  
  <p>I discovered that woocommerce uses this function to render the cart output:
  <a href="https://docs.woocommerce.com/wc-apidocs/source-function-wc_get_formatted_cart_item_data.html#3491-3563" rel="nofollow noreferrer">https://docs.woocommerce.com/wc-apidocs/source-function-wc_get_formatted_cart_item_data.html#3491-3563</a></p>
  
  <pre><code>function wc_get_formatted_cart_item_data( $cart_item, $flat = false ) {
  </code></pre>
  
  <p>And calls the template file to render the output:</p>
  
  <pre><code>wc_get_template( 'cart/cart-item-data.php', array( 'item_data' =&gt; $item_data ) );
  </code></pre>
  
  <p>I can't just edit cart-item-data.php file because I need the ID fo the product from the variable $cart_item.</p>
  
  <p>So I thought about overriding the function wc_get_formatted_cart_item_data and pass an additional argument to the template file. But I can't get it to work.</p>
  
  <p>How can a remove_action look in this case?</p>
  
  <p>Something like:</p>
  
  <pre><code>remove_action( 'woocommerce_before_cart', 'wc_get_formatted_cart_item_data' );
  </code></pre>
  
  <p>Best, Marko</p>