Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
87 stars 33 forks source link

Virtual products wants shipping at resubscription if changed from simple to variable since cancellation #405

Open jacoswan opened 1 year ago

jacoswan commented 1 year ago

Describe the bug

The cart and checkout page will demand a shipping method when trying to resubscribe to a virtual/downloadable Simple Subscription product if it was changed to a virtual/downloable Variable Subscription product since the original subscription was canceled.

To Reproduce

  1. Create a Simple subscription product.
  2. Example, 60 per month (doesn't matter)
  3. Be sure to check Virtual and set Product Data > Advanced > Limit subscriptions : Limit to one active
  4. Publish
  5. Subscribe to the Simple subscription.
  6. Cancel the subscription, making sure it's also canceled on the admin side and not "Pending cancellation", so the subscriber has the option to Resubscribe and not Resume.
  7. Go back to the product and change it to a Variable subscription.
  8. Add an attribute and variation. Mark the variation as Virtual as well, as it's still a virtual product.
  9. Update.
  10. Head back to the subscriber's view of their subscription, and click to Resubscribe

Notice the cart and checkout page now has a shipping section, which is unexpected. Also, if no methods are configured, checkout is not possible.

Expected behavior

As both the Simple version and the Variable version of the Subscription product is virtual, the expectation would be that shipping wouldn't be involved.

Actual behavior

A shipping method is demanded when trying to resubscribe. Renewals of active subscriptions are not affected, it appears to just be the resubscription checkout process.

Product impact

Additional context

Simple subscription setup, showing only non-default settings:

6MxWjB.png

t8SwlL.png

After subscribing, cancel as customer and as admin so that the customer sees this in My Account > Subscriptions:

A562Fg.png

Change the Simple subscription product to a Variable Subscription product:

sMC6G7.png

OIXhiv.png

Then, as the customer, click the Resubscribe button to see the cart and checkout pages demanding a shipping method. On the test site, no methods are available, otherwise configured shipping methods are displayed as usual:

6V2Mk6.png MqIwLo.png

``` ### WordPress Environment ### WordPress address (URL): https://woo.tst Site address (URL): https://woo.tst WC Version: 7.3.0 REST API Version: ✔ 7.3.0 WC Blocks Version: ✔ 9.1.5 Action Scheduler Version: ✔ 3.4.0 Log Directory Writable: ✔ WP Version: 6.1.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: Apache/2.4.54 (Unix) OpenSSL/1.1.1q PHP/8.1.11 PHP Version: 8.1.11 PHP Post Max Size: 500 MB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.85.0 (SecureTransport) OpenSSL/1.1.1q SUHOSIN Installed: – MySQL Version: 10.8.3-MariaDB Max Upload Size: 500 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 7.4.0 WC Database Prefix: wp_ Total Database Size: 40.33MB Database Data Size: 24.83MB Database Index Size: 15.50MB 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.08MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 1.52MB + Index: 0.52MB + 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: 2.02MB + Index: 1.13MB + 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: 1.52MB + Index: 0.63MB + Engine InnoDB wp_afwc_campaigns: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_afwc_commission_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_afwc_hits: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_afwc_payouts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_afwc_payout_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_afwc_referrals: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_asre_sales_report: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_automatewoo_customers: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_automatewoo_customer_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_events: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_guests: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_log_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_queue: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_queue_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_referrals: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_automatewoo_referral_advocate_keys: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_automatewoo_referral_invites: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.47MB + Index: 0.55MB + Engine InnoDB wp_followup_coupons: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_coupon_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_customers: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_followup_customer_carts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_followup_email_excludes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_orders: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_followup_email_tracking: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_followup_followup_history: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_followup_order_categories: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_followup_order_items: Data: 0.05MB + Index: 0.05MB + Engine InnoDB wp_followup_subscribers: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscribers_to_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscriber_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gf_form_view: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB wp_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_gla_shipping_rates: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 7.03MB + Index: 0.22MB + Engine InnoDB wp_postmeta: Data: 6.50MB + Index: 7.66MB + Engine InnoDB wp_posts: Data: 2.50MB + Index: 0.44MB + Engine InnoDB wp_sensei_pro_groups_courses: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_sensei_pro_groups_students: Data: 0.02MB + Index: 0.02MB + 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.16MB + Index: 0.19MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcpv_commissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcrp_rental_products_rentals: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcs_payment_retries: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + 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_bundle_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_order_composite_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.08MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.06MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points_log: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.17MB + Index: 0.34MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + 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 wp_woocommerce_bis_activity: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_bis_notifications: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_woocommerce_bis_notificationsmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_itemmeta: Data: 0.09MB + Index: 0.13MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_exported_csv_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_gc_activity: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_gc_cards: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_gc_cardsmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_pickup_locations_geodata: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_table_rates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_software_activations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_software_licenses: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### addify_rfq: 1 admin_login_history: 3 attachment: 65 aw_workflow: 12 bookable_person: 1 bookable_resource: 15 course: 1 custom_css: 2 customize_changeset: 8 dey_time_slots: 1 event_ticket: 13 global_product_addon: 1 lesson: 3 mailpoet_page: 1 nav_menu_item: 8 page: 31 post: 3 product: 1149 product_variation: 251 quiz: 3 revision: 155 shipping_package: 1 shop_bogof_rule: 1 shop_coupon: 7 shop_order: 338 shop_order_refund: 13 shop_subscription: 55 user_request: 1 wbcr-snippets: 25 wc_booking: 6 wc_membership_plan: 3 wc_pickup_location: 1 wc_user_membership: 9 wc-quote: 1 wc-quote-rules: 1 wccc: 1 wcpf_item: 4 wcpf_project: 1 wp_global_styles: 4 wp_navigation: 1 wp_template: 1 wp_template_part: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (5) ### Bookings Helper: by WooCommerce – 1.0.3 WooCommerce Beta Tester: by WooCommerce – 2.1.0 WooCommerce Stripe Gateway: by WooCommerce – 7.0.2 WooCommerce Subscriptions: by WooCommerce – 4.8.1 WooCommerce: by Automattic – 7.3.0 ### Inactive Plugins (177) ### ... ### Settings ### API Enabled: – Force SSL: – Currency: GBP (£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: accommodation-booking (accommodation-booking) booking (booking) bundle (bundle) composite (composite) 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) 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) simple (simple) Connected to WooCommerce.com: ✔ Enforce Approved Product Download Directories: ✔ Order datastore: WC_Order_Data_Store_CPT ### WC Pages ### Shop base: #6 - /shop/ Cart: #7 - /cart/ Checkout: #8 - /checkout/ My account: #9 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 4.2.0 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: – ### Subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://woo.tst Subscriptions-core Library Version: 5.3.1 Subscription Statuses: auto-draft: 2 wc-active: 5 wc-expired: 1 wc-pending: 1 wc-cancelled: 46 WooCommerce Account Connected: ✔ Yes Active Product Key: ❌ No Custom Retry Rules: ✔ No Custom Retry Rule Class: ✔ No Custom Raw Retry Rule: ✔ No Custom Retry Rule: ✔ No Retries Migration Status: ✔ Completed Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure ### Store Setup ### Country / State: United Kingdom (UK) ### Subscriptions by Payment Gateway ### other: wc-cancelled: 2 Stripe: wc-active: 5 wc-cancelled: 40 wc-expired: 1 ### Payment Gateway Support ### Stripe: products refunds tokenization add_payment_method subscriptions subscription_cancellation subscription_suspension subscription_reactivation subscription_amount_changes subscription_date_changes subscription_payment_method_change subscription_payment_method_change_customer subscription_payment_method_change_admin multiple_subscriptions ### Admin ### Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-marketing mobile-app-banner navigation onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page Disabled Features: minified-js new-product-management-experience settings Daily Cron: ✔ Next scheduled: 2023-02-09 06:14:14 +00:00 Options: ✔ Notes: 35 Onboarding: completed ### Action Scheduler ### Complete: 3,382 Oldest: 2023-01-08 18:17:30 +0000 Newest: 2023-02-08 11:10:24 +0000 Failed: 27 Oldest: 2022-11-18 13:14:34 +0000 Newest: 2023-02-03 14:28:53 +0000 Pending: 13 Oldest: 2023-02-08 11:26:05 +0000 Newest: 2023-11-30 00:00:00 +0000 ### Status report information ### Generated at: 2023-02-08 11:23:25 +00:00 ```