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
- How to implement my product variations/attributes in my contact form 7 email?
- I want to Display custom woocomerce meta box in orders list
- I want to update shipping charge $0 for all Woocommeerce Subscription auto-renewal orders
- Add custom text to product category page
- using custom pages for myaccount in woocommerce
- sort by date in users
- Which php files, in a WordPress setup, do not need direct web access?
- Detect Product Type with code
- Woocommerce permalink URL change in DB
- How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
- Verify if woocommerce supports this design [closed]
- How to get all child categories of current parent category in product detail page of woocommerce? [closed]
- Mandatory Fields For WooCommerce Products Before Publishing
- Can’t add variable products since update WooCommerce [closed]
- In woo commerce , Products change back to “Draft” from “published” automatically after it is purchased on the woo commerce shop page.Theme WP rentals [closed]
- Hook for Woocommerce checkout fields
- additional fields based on the quantity of products selected
- Add custom ID to WooCommerce product tab
- Conflict between Woocommerce Booking + Woocommerce Product Options [closed]
- Show shipping class in admin product list
- Loading specific ajax from a product
- How to add fee_lines using woocommerce rest API v3?
- Account Status/Login on Main Menu with Avatar Pictures
- ACF Create Array of All Woocommerce Product IDs with a Checkbox ticked
- How to display customer email within the meta order data box
- Woocommerce products permalink based on SKU
- Add a custom field for sorting the products in a specific category WOOCOMMERCE – Second try
- Bulk delete ‘Global Attributes’ in WooCommerce via WP-CLI?
- Checkout page not loading on my ecommerce website
- Error: DNS_PROBE_FINISHED_NXDOMAIN WordPress / Woocommerce
- Woocommerce ajax checkout get wc_checkout_params is not defined