Skip to content

[Min/Max Quantities Edit Support] UI + Sync Logic #12758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 20, 2024

Conversation

toupper
Copy link
Contributor

@toupper toupper commented May 16, 2024

Closes: #12718

Description

With this PR we implement the edit support for Min/Max Quantities in the product and variations detail forms.

Testing instructions

Store without the Min/Max Quantities plugin installed. We don't show the Min/Max Quantities row in product and product variation details:

  1. Go to a store without the Min/Max Quantities installed.
  2. Open the app, and go to the products tab.
  3. Tap on any product
  4. You don't see any row about the Min/Max Quantities:

Simulator Screen Recording - iPhone 15 - 2024-05-15 at 10 25 12

Store with the Min/Max Quantities plugin installed, but no values set in product. We show the Quantity Rules row with no rules:

  1. Go to a store without the Min/Max Quantities installed.
  2. Open the app, and go to the products tab.
  3. Tap on any product
  4. You see any row about the Min/Max Quantities row without any rule:

Store with the Min/Max Quantities plugin installed, and values set in product. We show the Quantity Rules row with rules:

  • We show maximum two rows.
  • Order priority is min, max group by.

Quantity Rules screen shows values and placeholder when there is none:

  1. Go to a store without the Min/Max Quantities installed.
  2. Open the app, and go to the products tab.
  3. Tap on any product
  4. Tap on the Quantity Rules row.
  5. It opens the Quantity Rules screen with placeholders:

Edit Quantity Rules:

  1. Go to a store without the Min/Max Quantities installed.
  2. Open the app, and go to the products tab.
  3. Tap on any product
  4. Tap on the Quantity Rules row.
  5. Edit Quantity Rules with happy path (valid values):
Simulator.Screen.Recording.-.iPhone.15.-.2024-05-16.at.15.54.25.mp4

Product Variations:

We show the Quantity Rules row in product variations detail views if:

  • The store has the Min/Max Quantities Plugin Installed
  • The product variation overrides the parent quantities
  • The parent product disables quantity rules

These two latter values can be set in wp-admin (Not in the app in this milestone)

  1. Go to a store without the Min/Max Quantities installed.
  2. Open the app, and go to the products tab.
  3. Tap on any product with variations.
  4. Tap on any variation.
  5. Tap on the Quantity Rules row
  6. You can edit the Quantity Rules
Simulator.Screen.Recording.-.iPhone.15.-.2024-05-16.at.16.22.08.mp4

Errors:

We show the errors messages returned from the requests. These are

"woocommerce_rest_invalid_max_quantity"
"woocommerce_rest_invalid_min_quantity"
"woocommerce_rest_invalid_variation_max_quantity"
"woocommerce_rest_invalid_variation_min_quantity"

As these errors are dynamic, we can test if we show the right message by debugging the code or inspecting the response with Proxyman. You can test the behavior with inconsistent input:

  • Min values bigger than Max
  • Max values smaller than Mix
  • Min Max values not in sync with group by (they should be multiples of the former)

Example: Entering a min value bigger than the maximum:

Simulator.Screen.Recording.-.iPhone.15.-.2024-05-16.at.16.27.33.mp4

Screenshots

See above


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@toupper toupper added type: task An internally driven task. feature: product details Related to adding or editing products, including Product Settings. category: woo extensions Related to WC extensions or plugins. labels May 16, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 16, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr12758-55663c4
Version18.6
Bundle IDcom.automattic.alpha.woocommerce
Commit55663c4
App Center BuildWooCommerce - Prototype Builds #9116
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@toupper toupper added this to the 18.8 milestone May 17, 2024
@toupper toupper merged commit f6f0b22 into trunk May 20, 2024
23 checks passed
@toupper toupper deleted the issue/12718-min-max-quantities-edit-UI branch May 20, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: woo extensions Related to WC extensions or plugins. feature: product details Related to adding or editing products, including Product Settings. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Min/Max Quantities] Implement UI
2 participants