title: WooCommerce remove product button in checkout
body: <p>we're using a PHP string to enable the option to remove products in the checkout.</p>
  <p>Following code:</p>
  <pre><code>    /**
   * Allows to remove products in checkout page.
   * 
   * @param string $product_name 
   * @param array $cart_item 
   * @param string $cart_item_key 
   * @return string
   */
  function lionplugins_woocommerce_checkout_remove_item( $product_name, $cart_item, $cart_item_key ) {
      if ( is_checkout() ) {
          $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
          $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
  
          $remove_link = apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
              '&lt;a href=&quot;%s&quot; rel=&quot;nofollow&quot; class=&quot;remove-icon&quot; style=&quot;float:left;&quot;&gt;x&lt;/a&gt;',
              esc_url( WC()-&gt;cart-&gt;get_remove_url( $cart_item_key ) ),
              __( 'Remove this item', 'woocommerce' ),
              esc_attr( $product_id ),
              esc_attr( $_product-&gt;get_sku() )
          ), $cart_item_key );
  
          return '&lt;span&gt;' . $remove_link . '&lt;/span&gt; &lt;span&gt;' . $product_name . '&lt;/span&gt;';
      }
  
      return $product_name;
  }
  </code></pre>
  <p>But the layout is a bit messed up.</p>
  <p><a href="https://i.stack.imgur.com/u98S9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u98S9.png" alt="checkout" /></a></p>
  <p>Is there a way to force the table structure to have it always float far left/right? Like a forced float, or a sort of &quot;separate&quot; table column just for the remove button. I tried tweaking the CSS for the icon and add more padding or change the icon type but with no success.</p>
  <p>Still quite clueless to PHP and coding so any help or guidance would be greatly appreciated.</p>
  <p>edit:
  I believe this is the answer for other people - <a href="https://stackoverflow.com/questions/44241876/woocommerce-how-to-remove-product-lines-on-checkout-page">Woocommerce : How to remove product lines on Checkout page?</a></p>
  <p>However we're using &quot;WooCommerce Composite Products&quot; which makes the a.remove button float in different location as shown in the image above.</p>