title: Updating cart subtotal in WooCommerce
body: <p>I want to update cart subtotal in WooCommerce.</p>
  
  <p>How can add action for modifying subtotal in WooCommerce?</p>
  
  <p>I have tried to by this code, but is not working. I would like to multiply by 12 the cart subtotal and to display this calculation on cart page.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>add_action( 'woocommerce_before_calculate_totals', 'add_custom_price' );
  function add_custom_price( $total) {
  
      foreach ( $total-&gt;cart_contents as $key =&gt; $value ) {
  
          $modifiedtotal = $total-&gt;subtotal * 12; 
          // --------------------------------
          //how can get subtotal with multiply by 12 and it should be show on cart page.
      }
  }
  </code></pre>