woocommerce / woocommerce-android

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

No preview product option for variable products through the order details screen #4429

Open reginabally opened 3 years ago

reginabally commented 3 years ago

Describe the bug

It was reported in 4136359-zd-woothemes that since the app version 6.9, the "View product on store" option went missing when accessing the product through the order details screen.

I was able to reproduce this with a variable product.

To Reproduce Steps to reproduce the behavior:

  1. Go to Orders, select an order that has a variable product.
  2. Tap the variable product to go to the product details screen.
  3. Tap the three dots on the top right corner of the screen.
  4. See that the only option is "Delete".

Screen recording

https://user-images.githubusercontent.com/40906847/125565115-1f67aa29-fa9b-4709-a58c-5c64414160ab.mp4

Expected behavior

I would expect to see the "View product on store" option when I access the product details through the orders details screen.

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

Mobile Environment Please include:

WordPress Environment

``` ` ### WordPress Environment ### WordPress address (URL): https://woo20210709.mystagingwebsite.com Site address (URL): https://woo20210709.mystagingwebsite.com WC Version: 5.4.1 REST API Version: ✔ 5.4.1 WC Blocks Version: ✔ 5.1.0 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 2.3.1 Log Directory Writable: ✔ WP Version: 5.7.2 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.4.21 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.77.0 OpenSSL/1.1.1d SUHOSIN Installed: – MySQL Version: 5.5.5-10.4.20-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: 5.4.1 WC Database Prefix: wp_ Total Database Size: 4.79MB Database Data Size: 3.32MB Database Index Size: 1.47MB wp_woocommerce_sessions: Data: 0.08MB + 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_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 2.25MB + Index: 0.06MB + Engine InnoDB wp_postmeta: Data: 0.13MB + Index: 0.09MB + Engine InnoDB wp_posts: Data: 0.05MB + Index: 0.06MB + 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.05MB + 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_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_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 ### Post Type Counts ### attachment: 23 customize_changeset: 1 page: 6 post: 1 product: 24 product_variation: 9 shop_order: 2 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (2) ### Jetpack: by Automattic – 9.9 WooCommerce: by Automattic – 5.4.1 (update to version 5.5.0 is available) ### Inactive Plugins (2) ### Akismet Anti-Spam: by Automattic – 4.1.10 WooCommerce Shipping & Tax: by WooCommerce – 1.25.15 (update to version 1.25.17 is available) ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) 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: #5 - / Cart: #6 - /cart/ Checkout: #7 - /checkout/ My account: #8 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 3.7.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: – ### Action Scheduler ### Complete: 10 Oldest: 2021-07-09 06:32:23 +0000 Newest: 2021-07-14 05:07:22 +0000 Pending: 1 Oldest: 2021-07-14 05:15:48 +0000 Newest: 2021-07-14 05:15:48 +0000 ### Status report information ### Generated at: 2021-07-14 05:14:58 +00:00 ````
reginabally commented 3 years ago

Also reported this issue on WCiOS: https://github.com/woocommerce/woocommerce-ios/issues/4609

malinajirka commented 2 years ago

This issue is a bit tricky and might not be a "good first issue" until we clarify what is the expected behavior.

It seems that we have two different screens in the code (they are very very similar on the UI)

  1. Open Detail of a variable product on the Product list screen
  2. ProductDetailFragment is shown
  3. Tap on Variations
  4. Tap on one of the variations
  5. VariationDetailFragment is shown

  6. Open detail of an order
  7. Tap on a variation product
  8. VariationDetailFragment is shown => "View product on store" action is NOT available
  9. Go back
  10. Tap on a non-variation product
  11. ProductDetailFragment is shown => "View product on store" is available

It seems that VariationDetailFragment was added in https://github.com/woocommerce/woocommerce-android/pull/2514. The PR title says it's "read-only" screen. However, it seems it's not read-only anymore -> I'm able to change product price etc on that screen 🤷 .

@AmandaRiu @0nko do you perhaps remember history and suggest the expected behavior? We could simply add "View product on store" to the VariationDetailFragment => which would redirect the user to the product, not to that specific variation. Wdyt?

AmandaRiu commented 2 years ago

@malinajirka Hrm, it's been such a long time since I've been in the WooCommerce space that I really don't remember. I know a lot of our screens were intentionally read only because we were slowly rolling out different features so first was the ability to view and order, then later we'd add the ability to edit an order..etc. So it's likely that's what was going on here.