Skip to content

Conversation

@RafaelKayumov
Copy link
Contributor

@RafaelKayumov RafaelKayumov commented Jul 24, 2025

Part of: WOOMOB-891

Description

Makes the HS tariff number required for shipments where destination country is in EU.

  • Adds explicit isHSTariffNumberRequired var for WooShippingCustomsItemViewModel that's driven by destination country being a member of Country.countriesFollowingEUCustoms.
  • isHSTariffNumberRequired participates in requiredInformationIsEntered calculation.
  • Makes the HS tariff number field as a required field in the WooShippingCustomsItem view:
    • Renders "value required" warning if destination country is EU and the HS tariff number is empty
    • Renders red border if destination country is EU and the HS tariff number is empty
    • Removes "Optional" placeholder in case if the HS tariff number is required.

Testing Steps

  • Navigate to a completed order with an unfulfilled shipment
  • Just in case make sure the total value for products in the shipment is below the 2500 threshold
  • Set a foreign destination address - for example some public address in Canada
  • Fill in missing shipment details.
  • Make sure the HS tariff field for customs form product items is optional
  • Switch shipment destination address to a EU country. Consider using some public address.
  • Make sure the customs section becomes incomplete.
  • Make sure the product HS tariff field is now a required field.
  • Enter HS tariff numbers for incomplete product customs cards and save the form
  • Make sure the customs section is now complete
  • Make sure label purchase flow is unlocked

  • 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 22.9 milestone Jul 24, 2025
@RafaelKayumov RafaelKayumov added type: task An internally driven task. feature: shipping labels Related to creating, ordering, or printing shipping labels. labels Jul 24, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 24, 2025

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 Numberpr15946-c249322
Version22.9
Bundle IDcom.automattic.alpha.woocommerce
Commitc249322
Installation URL2bcu5t4pu1n58
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot wpmobilebot modified the milestones: 22.9, 23.0 Jul 25, 2025
@wpmobilebot
Copy link
Collaborator

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

@RafaelKayumov RafaelKayumov force-pushed the WOOMOB-891-make-hs-tariff-number-mandatory-for-EU-destination branch from 6d00010 to 53e9359 Compare July 28, 2025 20:16
@RafaelKayumov RafaelKayumov marked this pull request as ready for review July 28, 2025 20:40
@itsmeichigo itsmeichigo self-assigned this Jul 29, 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.

This works as described 👍 I left some non-blocking comments.

.foregroundColor(warningRedColor)
.footnoteStyle()
.renderedIf(!viewModel.isValidTariffNumber)
///
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: redundant line.


let ((description, valuePerUnit, weightPerUnit, selectedCountry), hsTariffNumber, isHSTariffNumberRequired) = result

let hsTariffNumberRequirementMet = hsTariffNumber.isEmpty && !isHSTariffNumberRequired || isValidTariffNumber && hsTariffNumber.isNotEmpty
Copy link
Contributor

@itsmeichigo itsmeichigo Jul 29, 2025

Choose a reason for hiding this comment

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

Nit: I didn't know that && takes priority over ||. Still, should we add braces or split this into two properties for readability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌 Gonna add braces for readability

@RafaelKayumov RafaelKayumov merged commit 9a24237 into trunk Jul 29, 2025
13 checks passed
@RafaelKayumov RafaelKayumov deleted the WOOMOB-891-make-hs-tariff-number-mandatory-for-EU-destination branch July 29, 2025 15:26
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. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants