Scenario:
- Drupal site with "Member" and "Spouse" roles.
- For any given married couple, Member and Spouse each have their own user accounts.
- entity reference field from spouse defines the relationship between the 2 users
- an order exists, belonging to Member user (order->uid)

Desired functionality:
- Regardless of the uid value for order, allow either Member *or* Spouse to proceed through checkout and payment for the order.

**I realize this is not possible through vanilla commerce.**
I'm looking for any ideas that will help me figure out how to implement this via existing contrib modules, or a custom module.

Specific questions:
- Has anyone achieved this successfully?
- Are the any specific contrib modules that could help solve this?
- What specific hooks or overrides should I be looking at?

Bonus points for elegant workarounds or shortcuts like a simple hook_access override, or a clever way to just-in-time reassign the order uid.

Comments

aaronbauman created an issue. See original summary.

rszrama’s picture

Status: Active » Closed (fixed)

I don't know of any modules offering this functionality out of the box, nor is it straightforward to alter the access checks in commerce_checkout_router() early enough for your scenario. One thing you might do is use hook_commerce_order_load() and swap in the current user's uid as the $order->uid in the event that the current user is the spouse accessing a checkout page or something.

For future requests, let's stick to https://drupal.stackexchange.com w/ the drupal-commerce tag so others can find these sorts of tips in the future.

AaronBauman’s picture

I posted to stackexchange first, but my post was rejected for being "overly broad".

Thanks for the suggestion - I will give it a shot.

AaronBauman’s picture