Skip to content

Conversation

@robsoned
Copy link
Contributor

@robsoned robsoned commented Dec 10, 2025

Description:

This PR updates the logic responsible for handling delivery methods that contain a delivery_note related to risk areas.

Previously, the module appended an error to the shipping rate result (via append($error) or setError(true)), which prevents Magento from displaying any valid shipping methods, even when they exist. This happened regardless of whether delivery_risk_areas was enabled or disabled, resulting in checkout being blocked unnecessarily.

The new implementation ensures that:

  • No error is created when delivery_risk_areas is disabled.
  • Only the delivery method containing a risk-related delivery_note is skipped when risk areas are turned off.
  • Valid delivery methods continue to be displayed normally.
  • Logging occurs only when risk area handling is enabled.
  • Error behavior now aligns with configuration expectations.

Checklist:

Testing Instructions:

  1. With delivery_risk_areas = 0 (disabled):
  • Trigger a shipping rate request that includes a delivery_note.
  • Confirm no rate error is added.
  • Only the method with the delivery_note is skipped.
  • All valid shipping methods remain visible.

  1. With delivery_risk_areas = 1 (enabled):
  • Trigger the same request.
  • Confirm the module logs the risk area warning.
  • Confirm no rate error is added, and valid methods still display correctly.

@robsoned robsoned changed the title prevent risk area error when delivery_risk_areas is disabled Fix risk area handling to prevent unwanted rate errors and ensure valid methods are still displayed Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant