woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
277 stars 135 forks source link

No Notification If a New Order Has a Custom Order Status #2282

Closed SiobhyB closed 3 years ago

SiobhyB commented 4 years ago

Describe the bug

No notification is generated if a new order has a custom order status associated with it.

To Reproduce

Steps to reproduce the behavior:

  1. Install the WooCommerce Deposits extension on any WooCommerce site.
  2. Navigate to WooCommerceSettingsProductsDeposits to set up a required deposit for all new orders.
  3. Go through the steps to make an order on your site and pay the required deposit, this will set the order's status to Partially Paid.

Expected behavior

I'd expect to receive notifications of all new orders, even if they have a custom order status like Partially Paid.

The fact that extensions that change the status of new orders (including WooCommerce Deposits) are included in the official store on WooCommerce.com supports this expectation.

Isolating the problem (mark completed items with an [x]):

Mobile Environment

WordPress Environment

``` ### WordPress Environment ### WordPress address (URL): https://siobhantestshop.wpcomstaging.com Site address (URL): https://siobhantestshop.wpcomstaging.com WC Version: 4.0.1 REST API Version: ✔ 1.0.7 WC Blocks Version: ✔ 2.5.14 Action Scheduler Version: ✔ 3.1.4 WC Admin Version: ✔ 1.0.3 Log Directory Writable: ✔ WP Version: 5.4 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ✔ WP Cron: ✔ Language: en_GB External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.2.29 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.69.1 OpenSSL/1.1.0l SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.22-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 3.6.5 WC Database Prefix: wp_ Total Database Size: 3.93MB Database Data Size: 2.40MB Database Index Size: 1.53MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.02MB + Index: 0.11MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 1.09MB + Index: 0.06MB + Engine InnoDB wp_postmeta: Data: 0.22MB + Index: 0.13MB + Engine InnoDB wp_posts: Data: 0.19MB + Index: 0.06MB + Engine InnoDB wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_deposits_payment_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_deposits_payment_plans_schedule: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### attachment: 56 global_product_addon: 1 jetpack-portfolio: 1 jetpack_migration: 2 jp_img_sitemap: 3 jp_sitemap: 3 jp_sitemap_master: 3 nav_menu_item: 3 page: 7 post: 2 product: 27 product_variation: 4 revision: 10 shop_order: 5 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (9) ### Akismet Anti-Spam: by Automattic – 4.1.4 AMP: by AMP project contributors – 1.5.3 Gutenberg: by Gutenberg Editor Team – 7.8.1 Jetpack by WordPress.com: by Automattic – 8.4.2 Mailchimp for WooCommerce: by Mailchimp – 2.3.6 Storefront Powerpack: by WooCommerce – 2.0.0 WooCommerce Deposits: by WooCommerce – 1.4.20 WooCommerce Stripe Gateway: by WooCommerce – 4.3.3 WooCommerce: by Automattic – 4.0.1 ### Inactive Plugins (22) ### Classic Editor: by WordPress Contributors – 1.5 CoBlocks: by GoDaddy – 1.23.0 Facebook for WooCommerce: by Facebook – 1.10.2 Full Site Editing: by Automattic – 1.0 Klarna Checkout for WooCommerce: by Krokedil – 2.0.12 Klarna Payments for WooCommerce: by krokedil klarna automattic – 2.0.7 Layout Grid: by Automattic – 1.1 Page Optimize: by Automattic – 0.4.6 TaxJar - Sales Tax Automation for WooCommerce: by TaxJar – 3.1.0 WooCommerce Australia Post Shipping: by WooCommerce – 2.4.22 WooCommerce Canada Post Shipping: by WooCommerce – 2.5.15 WooCommerce eWAY Payment Gateway: by WooCommerce – 3.1.24 WooCommerce PayFast Gateway: by WooCommerce – 1.4.15 WooCommerce PayPal Checkout Gateway: by WooCommerce – 1.6.21 WooCommerce Product Add-ons: by WooCommerce – 3.0.30 WooCommerce Royal Mail: by WooCommerce – 2.5.25 WooCommerce Services: by Automattic – 1.23.0 WooCommerce Square: by WooCommerce – 2.1.1 WooCommerce Subscriptions: by WooCommerce – 3.0.3 WooCommerce Subscriptions Gifting: by WooCommerce – 2.1.0 – Not tested with the active version of WooCommerce WooCommerce UPS Shipping: by WooCommerce – 3.2.24 WooCommerce USPS Shipping: by WooCommerce – 4.4.41 ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Must Use Plugins (1) ### WP.com Site Helper: by – ### Settings ### API Enabled: – Force SSL: – Currency: GBP (£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: #103 - /store/ Basket: #186 - /basket/ Checkout: #187 - /checkout/ My account: #188 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 2.5.5 Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Action Scheduler ### Complete: 29 Oldest: 2020-04-09 13:56:37 +0100 Newest: 2020-04-19 13:39:45 +0100 ```
joshbetz commented 3 years ago

@astralbodies I see it's a hard-coded list of order statuses. From looking at the commit history, it sounds like the original goal was to prevent notifications for wc-pending. I guess there are 2 options:

  1. Add explicit support for any custom statuses that we think should get notifications.
  2. Reverse the logic and just exclude some statuses that we know should not get notification (like wc-pending).

I don't have a good sense of which route would be preferred here though.

astralbodies commented 3 years ago

@joshbetz Yeah I'm not sure of the right way to go here too. We could include the partially paid status in the backend to send out the notifications. I do think the logic old sends a new order notification once ever for an order, so even if it goes through several statuses, it should only fire once.

joshbetz commented 3 years ago

I deployed a change to send notifications for the wc-partial-payment status.