Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Aug 7, 2025

WOOMOB-891

Description

This is a re-created version of [Shipping Labels] Get rid of HSTariffNumberTotalValue validation logic targeting trunk

The PR addresses the suggestion from comment and deletes the redundant HS tariff class total amount check. The item class validation is not needed since the whole shipment gets an ITN number requirement if shipment total value exceeds 2500. In such case the tariff class validation will never reach execution.

  • Deletes hsTariffNumberTotalValue composure and corresponding tests
  • Makes totalValue reactive per item instead of computed.
  • Combine over totalItemValue for validation error calculation instead of itemsViewModels.

Testing

The current behaviour is already in trunk. The PR only deletes the redundant logic. But anyway check the following steps work as described:

  • Use a testing store with a Shipping plugin installed and running
  • Create an order with several product items with total order amount of 2500+ $. Keep these items under single shipment. Or open a similar order with a corresponding unfulfilled shipment.
  • Each item total should be less than 2500$. For example you could have 2 product items with total of 1500$ each. In my example I made it 1500$ and 1001$
Снимок экрана 2025-08-07 в 16 02 33
  • Make sure the shipment has a foreign destination address.
  • The "Customs" section should show the "Missing info" badge.
  • Open the "Customs" forms and make sure the "International Transaction Number" field is required.
  • Fill in random HSTariff numbers in customs form for each product item. For example 22.22.22.33
  • Make sure the "International Transaction Number" field is still displayed as required.

Screenshots

Снимок экрана 2025-08-07 в 15 54 28
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@RafaelKayumov RafaelKayumov added this to the 23.0 milestone Aug 7, 2025
@RafaelKayumov RafaelKayumov added the feature: shipping labels Related to creating, ordering, or printing shipping labels. label Aug 7, 2025
@wpmobilebot
Copy link
Collaborator

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

App NameWooCommerce iOS Prototype
Build Numberpr15990-b3b97d5
Version22.9
Bundle IDcom.automattic.alpha.woocommerce
Commitb3b97d5
Installation URL3fvn3kvig85ig
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot wpmobilebot modified the milestones: 23.0, 23.1 Aug 8, 2025
@wpmobilebot
Copy link
Collaborator

Version 23.0 has now entered code-freeze, so the milestone of this PR has been updated to 23.1.

@itsmeichigo itsmeichigo self-assigned this Aug 8, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Code changes look good, works as expected :shipit:

@RafaelKayumov RafaelKayumov merged commit a150143 into trunk Aug 8, 2025
21 of 23 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-891-delete-redundant-hstariff-class-validation-logic branch August 8, 2025 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: shipping labels Related to creating, ordering, or printing shipping labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants