Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
User experience
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Oct 2016 at 08:46 UTC
Updated:
8 Mar 2017 at 22:34 UTC
Jump to comment: Most recent
Comments
Comment #2
bojanz commentedQuestion is what to do on the user pages.
At checkout we know the order, which means we know the store, and can restrict the countries.
But on the user pages we don't know the store, which means that the user can specify a potentially restricted country.
Do we allow that but prevent such addresses from being selected at checkout?
Comment #3
bojanz commentedThis was partially resolved in #2844917: Create a commerce_profile_select form element and field widget.
The country list is now correctly restricted on:
1) Order edit
2) Billing information pane (used when there are no payments)
3) PaymentInformation (billing information collected when an offsite gateway is used)
The list is still not restricted in PaymentMethodAddForm (the checkout form for onsite gateways).
We need to restrict it there as well, and add tests.
Regarding #2, the filtering out of non-suitable profiles is being solved in #2832493: Checkout shows payment methods which cannot be reused.
On user pages we restrict the list to the one on the default store, but only if there's just a single store.
That covers the use case for non-multistore websites at least.
Comment #4
steveoliver commentedComment #5
steveoliver commentedSo how do we know in the context of the PaymentMethodAddForm if we are in the context of an order checkout, or if we are under the user's 'Create payment method' screen?
Comment #6
bojanz commentedWe'll need to take the route match and see whether it contains an order, I guess.
Either that or pass #order to the plugin form. I avoided that previously so that gateways don't accidentally always rely on its presence.
Comment #7
steveoliver commentedYep, makes sense. Here we go: https://github.com/drupalcommerce/commerce/pull/619/files
Comment #8
bojanz commentedWrapping this up (test coverage, fallback to default store).
Comment #10
bojanz commentedDone.