Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Remove Shipping Method from invoice
- This topic has 4 replies, 2 voices, and was last updated 4 years, 6 months ago by Henriette.
- AuthorPosts
- May 7, 2020 at 5:15 pm #128027
- May 8, 2020 at 3:46 pm #128370Sarmistha ChakrabortyMember
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.
- May 9, 2020 at 1:33 pm #128771HenrietteParticipant
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() ) ) : '–'; 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. - May 9, 2020 at 2:38 pm #128808Sarmistha ChakrabortyMember
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.
- May 10, 2020 at 9:17 am #129054HenrietteParticipant
Perfect thank you!
May I compliment you on how you know all of this.
It amazes me every time.
- AuthorPosts
- You must be logged in to reply to this topic.