Firstly, get_shipping_method is a function. You seem to be using it as a variable.
Secondly $order->get_shipping_method() returns Shipping method label, which you’re trying to compare with id.
Now you can either compare Titles, or use
$order->get_items( 'shipping' );
which returns an array with name, type, method_id, cost and taxes, and use method_id for comparison.
Related Posts:
- Woocommerce: Prevent sending of email when order is “Completed”
- WooCommerce order complete email logic
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- WordPress woocommerce new order email not working
- Custom Email via Hook only for completed order
- Access custom meta_data in processing order email
- Woocommerce admin order email customize – remove product short description
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- Preventing WooCommerce email sending only on particular conditions
- woocommerce fail to replace template string in email title [closed]
- WooCommerce: display text instead of raw checkbox value email
- Editing Header Titles of each details in woocommerce Order Email [closed]
- Woocommerce change tax rate programmaticly
- Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]
- WooCommerce email text based on category && shipping zone && payment method [closed]
- WooCommerce: Email Notifications
- How do I get the latest note on the order at woocommerce? [closed]
- Create WooCommerce new order with specific ID
- woocommerce_email_attachments filter arguments [closed]
- WordPress ‘on behalf of’ email
- WooCommerce: The model of e-mail is displaying only the html, not css [closed]
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Add custom order meta to Order Completed email
- how to do a processing Orders into Complete after x Minutes or x hour in WooCommerce [closed]
- How to add a user custom field into Woocommerce emails?
- WooCommerce quick checkout form? [closed]
- Custom Admin Email Subject for Woocommerce (3.8.0) Orders
- woocommerce email template detect email recipient
- WooCommerce orderby template disappears and not longer works on search page
- Adding extra email address who receives email like admin – woocommerce
- How to get woocommerce selected variation from order object
- Add shipping address to Woocommerce order emails [closed]
- Woocommerce emails from gmail not being sent
- Cancelled orders move to Trash automatically in Woocommerce – how to disable?
- Send admin new order email to logged in user as well
- how can i add an additional action into woocommerce admin order page through my plugin?
- Create a regular post for every WooCommerce order
- Create new email in WooCommerce
- How to alter taxes amounts when updating an order
- How to check if woocommerce_order_item_name is use in email?
- Sort products by Sale price and stock status
- Create order actions from custom fields woocommerce
- How to sort products by price ASC and place all no price products to the end? (Woocommerce)
- How to add (and change the font of) the short product description to order page and customer’s new order e-mail [closed]
- How to send Woocommerce Customer Details (Name, Email and Phone Number) to Admin upon signup
- How to change lost password email text using custom plugin wordpress?
- Using admin email in billing address
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- Change the customer’s name to a link on an order management page
- How to save one API response to WooCommerce order meta data
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Send a different “thank you” email based on payment method
- Customer Email Address
- Adding time of order to Admin email for new order
- Add button linked to single product page on order detail page
- Multiple sorting criteries (order by)
- Send default WooCommerce email when switching from custom order status
- Woocommerce order_complete email dont send after changing order status via sql
- how to add custom reviews button in woocommerce order complete generated mail
- How to add coupon expiry date into the followup emails?
- Product atributes in title of order (not in description)
- Manual Woocommerce Complete order Emails
- Turkish Character Problem on mailing
- WooCommerce: Order Details Table > Add Product Meta
- How to override email text New Customer Order?
- Woo-Commerce new order email no style attached
- WooCommerce – How to add a custom field to only a specific email template [closed]
- Insert a custom field as a second email address to a completed order in WooCommerce
- Critical error on woocommerce checkout page
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- How to disable Woocommerce password recovery and use the default WordPress password reset page?
- Display WooCommerce size product attribute on shop page
- WooCommerce add_to_cart() with custom price [closed]
- Declaring custom woocommerce product type as virtual / downloadable only [closed]
- How to remove_action inside class [duplicate]
- Redirect if current user is logged out and current page is /my-account
- How to get total count for each star rating?
- Display a list subcategories under the main product category thumbnails?
- Unable to programmatically remove product from WooCommerce cart
- WooCommerce Apply Coupon to order AFTER taxes
- Rewriting Woocommerce Product Filters To URL Segments
- How to Change WooCommerce Variable product pricing by SKU or visible children id
- Is it possible to cache ?wc-ajax=get_variation
- echo product id and product_item_key in cart [closed]
- Redirect the single product page link to the shop page
- Is WooCommerce updates for WordPress necessary? [closed]
- How can I display *only* the child category of a product?
- How to implement Handling Fee like the Shipping on Cart and Checkout page on WooCommerce [closed]
- why featured product not updated in postmeta table in woocommerce?
- Display list of categories that contain products with a specific tag
- How to display empty stars on products with woocommerce?
- WooCommerce limited role
- Skip WooCommerce 4.5.x onboarding with WP-CLI [closed]
- Automatically making a newly saved payment method default in WooCommerce
- WooCommerce update_shipping_method ajax call wipes shipping method set on non-checkout page [closed]
- Product options/variations notice displays as an Alert [closed]
- create comment box in woo-commerce shop order [closed]
- Product variation attributes does not appear as it should in the cart – woocommerce [closed]
- Hide decimal on hompage, category and product page
- Woocommerce: how to know if the customer is canceled the order or the shop owner? [closed]