Remove Shipping Method from invoice

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Ultimate Remove Shipping Method from invoice

Viewing 4 reply threads
  • Author
    Posts
    • #128027
      Henriette
      Participant

      Hi,
      I would like to remove the shipping method line from Store Invoice.
      I have already searched in admin dashboard but I can not find where to disable it so maybe I need a snippet or something to achieve this?

      Thank you.

      Attachments:
      You must be logged in to view attached files.
    • #128370

      Hello,

      Add this code to your child theme’s functions.php

      In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/

      add_filter('wcfm_is_allow_invoice_order_shipping_line_items', '__return_false');
      you can override store invoice and make required changes.

      Override this folder templates – “wp-content\plugins\wc-frontend-manager-ultimate\views\vendor_invoice”
      to your “child theme\wcfm\vendor_invoice”

      Thanks.

    • #128771
      Henriette
      Participant

      Thank you but that is not what I meant.
      Now this whole piece is gone, see attachment.
      I only want to remove the line that says Shipping Method.

      I tried to find it in the store-invoice.php but the only thing I could find was this table and I don’t know how to remove that line from it.

      <tbody id="order_shipping_line_items">
      		  <?php
      			$shipping_methods = WC()->shipping() ? WC()->shipping->load_shipping_methods() : array();
      			foreach ( $process_shipping_items as $item_id => $item ) {
      				?>
      				<tr class="shipping <?php echo ( ! empty( $class ) ) ? $class : ''; ?>" data-order_item_id="<?php echo $item_id; ?>">
      					<td class="name" colspan="3">
      						<div class="view">
      							<?php echo ! empty( $item->get_name() ) ? wc_clean( $item->get_name() ) : __( 'Shipping', 'wc-frontend-manager-ultimate' ); ?>
      						</div>
      				
      						<div class="view">
      						  <?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ) ?>
      							<?php wc_display_item_meta( $item ); ?>
      							<?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ) ?>
      						</div>
      					</td>
      					
      					<?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?>
      				
      					<td class="line_cost">
      						<div class="view">
      							<?php
      							  $shipping_amt += wc_round_tax_total( $item['cost'] );
      								echo ( isset( $item['cost'] ) ) ? wc_price( wc_round_tax_total( $item['cost'] ), array( 'currency' => $order->get_currency() ) ) : '';
      				
      								if ( $refunded = $order->get_total_refunded_for_item( $item_id, 'shipping' ) ) {
      									echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
      								}
      							?>
      						</div>
      					</td>
      				
      					<?php
      						if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() && apply_filters( 'wcfm_store_invoice_tax_line_item', true ) ) {
      							foreach ( $order_taxes as $tax_item ) {
      								$tax_item_id    = $tax_item->get_rate_id();
      								$tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : '';
      								?>
      									<td class="line_tax no_ipad no_mob" >
      										<div class="view">
      											<?php
      												$shipping_tax += wc_round_tax_total( $tax_item_total );
      												$shipping_tax_breakups[$tax_item_id]['total'] += wc_round_tax_total( $tax_item_total );
      												echo ( '' != $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '&ndash;';
      				
      												if ( $refunded = $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ) ) {
      													echo '<small class="refunded">-' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>';
      												}
      											?>
      										</div>
      									</td>
      				
      								<?php
      							}
      						}
      					?>
      				</tr>
      				<?php
      			}
      			do_action( 'woocommerce_admin_order_items_after_shipping', $order->get_id() );
      		  ?>
      		</tbody>
      	<?php } ?>
      </table>
      Attachments:
      You must be logged in to view attached files.
    • #128808

      Hello,

      Try this code to your child theme’s functions.php

      add_filter( 'woocommerce_display_item_meta', 'mobilefolk_order_item_get_formatted_meta_data', 20, 3 );
      
      function mobilefolk_order_item_get_formatted_meta_data($html, $item, $args){
          $html_new = '';
          $strings = array();
          foreach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {
          	if($meta->key != 'method_slug') {
      				$value     = $args['autop'] ? wp_kses_post( $meta->display_value ) : wp_kses_post( make_clickable( trim( $meta->display_value ) ) );
      				$strings[] = $args['label_before'] . wp_kses_post( $meta->display_key ) . $args['label_after'] . $value;
      			}
      		}
      
      		if ( $strings ) {
      			$html_new = $args['before'] . implode( $args['separator'], $strings ) . $args['after'];
      		}
          return $html_new;
      }

      Thanks.

    • #129054
      Henriette
      Participant

      Perfect thank you!
      May I compliment you on how you know all of this.
      It amazes me every time.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.