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
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- Where can I find a single item template
- How to update the WooCommerce cart Icon to show new products added with JavaScript
- How to configure Woocommerce Payment Methods programmatically?
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Subscription on Checkout
- Woocommerce – display product in page but in list format with excerpt
- How to increase execution time out limit in WordPress dashboard?
- Add to Cart button displaying twice on Shop Page Woocommerce
- How to exclude a taxonomy from shop & search page wooCommerce?
- WooCommerce how to checkout a product without adding it to the cart
- How to add a “buy now” button below “add to cart” button [closed]
- Cart page displays the price and amount as zero regardless of price entered [closed]
- How to display customer mobile number in woocommerce customers page
- woocommerce add button underneath order details
- Where do I remove admin order fields (unset doesn’t work)
- How to trace errors in debug.log for WooCommerce 3.0?
- Auto set Woocommerce product ID as SKU on save
- I want to show always 4 category boxes everytime in woocommerce
- Possible to have multiple Authorize.net accounts on the same site?
- Allow HTML in product attributes for WooCommerce
- Woocommerce – change image issue
- Put data in my-account/view-order/id/ page
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Send form data to functions.php
- Woocommerce how to show most selling products by category
- AffiliateWP not calculating multiple quantities when using affwp_calc_referral_amount filter
- Hide a shipping method if cart total is higher than an amount
- WordPress pointing animated GIF images with wrong file name upon upload (GIFs animation not working)
- How to update all products with same SKU prefixes when updating stock with CSV?
- What is the best and cheapest way to generate dashboards about conversions data and store users? [closed]