Registry Mirror
Skip to content

Conversation

@grandnode-dev

Copy link
Copy Markdown
Member

Type: bugfix

Issue

ShippingPointRateProvider.ValidateShippingForm checks the shipping point a customer picked at checkout.

  • It loaded the posted point by id without checking its store. The point list (/Plugins/SelectedShippingPoint/Points) only shows the points of the current store and the points of every store, but a posted id of another store's point was accepted, and its pickup fee became the shipping rate.
  • It took the offered option with First(...). When the offered options stored for the customer (from an earlier visit, another address) did not include the shipping point method, it threw and the checkout step answered 500.

Solution

The posted point must be one the current store lists: its own, or one of every store (empty StoreId), the same rule as the list. The offered option is looked up with FirstOrDefault. In both cases the customer is asked to select a point again ("Shipping.ShippingPoint.SelectBeforeProceed"), as for a point that does not exist.

Breaking changes

None.

Testing

  • ShippingPointRateProviderFormTests (new; Grand.Modules.Tests now references the plugin): a point of another store and offered options without the point method both ask to select a point (both fail on develop). A point of the store sets its fee as the rate, and a point of every store is accepted.
  • Grand.Modules.Tests: 478 passed.

…ed option

ValidateShippingForm loaded the posted point by id without checking its store, so a point of another store, with its pickup fee, could be chosen; the point list filters by store. It also threw when the offered shipping options stored for the customer did not include the shipping point method. Both now ask to select a point again.
Copilot AI balanced review requested due to automatic review settings November 28, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.


Assert.AreEqual(0, errors.Count);
_customers.Verify(x => x.UpdateUserField(_customer, SystemCustomerFieldNames.OfferedShippingOptions,
It.Is<List<ShippingOption>>(o => o.Single().Rate == 3), "store1"), Times.Once);
support added 2 commits November 29, 2026 11:02
…-form-store

# Conflicts:
#	src/Plugins/Shipping.ShippingPoint/ShippingPointRateProvider.cs
…-form-store

# Conflicts:
#	src/Tests/Grand.Modules.Tests/Grand.Modules.Tests.csproj
@grandnode-dev
grandnode-dev merged commit 87c6212 into develop Nov 29, 2026
9 checks passed
@grandnode-dev
grandnode-dev deleted the fix/shipping-point-form-store branch November 29, 2026 10:45
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.

2 participants