Skip to content
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

Display a total product price with quantity in Discount view to match what is displayed in Order view #13313

Conversation

staskus
Copy link
Collaborator

@staskus staskus commented Jul 12, 2024

Closes: #11393

Description

When fixing other parts of product pricing within Order view #13305 I noticed a fairly easy solution for #11393.

Problem

If the product quantity is more than 1, then "Price after discount" is displayed for all the quantity of the product within the Order view, and for a single item within the Discount view. We should make sure the presentation is consistent.

Discount View Order View
Add Discount - Discount page - Before Add Discount - Order - Before

Solution

Use orderItem.subtotal within Discount view, which is a pre-tax pre-discount product price multiplied by the quantity. After #13305 is merged the fix will work well for both "Prices entered with tax" settings.

Steps to reproduce

Testing information

Steps to reproduce the behavior:

  • Go to the orders tab
  • Tap + to create an order
  • Tap Add Products and select a product or variation
  • Tap to expand the product card
  • Increment the quantity to be larger than 1
  • Tap Add discount
  • Enter some non-zero amount to the text field
  • Confirm the "Price after discount" field shows the total discounted price
  • Tap Add --> after syncing
  • Confirm "Price after discount" field shows the total discounted price in the order form, the same as in Discount view

Screenshots

Discount View Order View
Add Discount - Discount Page - After Add Discount - Order - After

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

…upport quantity

OrderItem subtotal is a pre-tax pre-discount product value that is multiplied by quantity. We can use it instead of product price to display a total product price with quantity after discount within Discount View
@staskus staskus added type: bug A confirmed bug. feature: order creation All tasks related to creating an order labels Jul 12, 2024
@wpmobilebot
Copy link
Collaborator

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 Numberpr13313-f9cd655
Version19.4
Bundle IDcom.automattic.alpha.woocommerce
Commitf9cd655
App Center BuildWooCommerce - Prototype Builds #9983
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@staskus staskus marked this pull request as ready for review July 15, 2024 09:33
@iamgabrielma iamgabrielma self-assigned this Jul 16, 2024
Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well! 🚢

@staskus staskus merged commit 9fa7dd6 into trunk Jul 16, 2024
30 checks passed
@staskus staskus deleted the fix/11393-discount-view-price-after-discount-is-only-for-single-item branch July 16, 2024 11:00
@staskus staskus added this to the 19.6 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order creation All tasks related to creating an order type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Order form > edit discount: when quantity is greater than 1, the price after discount doesn't show the total
3 participants