Account created on 22 January 2025, 3 months ago
#

Recent comments

Update:

Yes! The starting event "Order: Assign order" worked better. Using the [commerce_customer] I can add the user as the group member and I guess I could grant a role also.

As a related topic, I'm trying to do this when a specific product is in the order, but I couldn't. I'm facing the same problem as described in https://www.drupal.org/project/eca_commerce/issues/3478960 🐛 Commerce: Specific Products Active so, at this point, the workaround for me is looping the order items list and checking each item to see if the product is in the order.

The user part is solved for me!

Hi Jürgen! In the beginning, I used the value of [commerce_order:mail] to get the user using "Entity:load" and the option "Type and properties" with property: mail: "[commerce_order:mail]".

I tested this Entity:load using and existing customer-user email and it worked. When I replaced the fixed mail with the token [commerce_order:mail] it didn't. The debug showed: Access denied - No entity available.

So I made a test with a loop checking the existing users at that point, to see if the customer is already in the list (in case I was not using the token properly, for example). I used showing messages to see the results of the loop. In the results, the customer is not there as a user.

The customer data is in the checkout - somewhere -, but in order to add the user to the Group, I need to have the user itself as entity.

So it's related I think with what you mention about the \Drupal\commerce_order\Event\OrderEvents::ORDER_ASSIGN. Yes, ECA records show "- user (Entity user/0/Anonymous)" being passed through the model.

I will check "Order: Assign order" and will let you know! Thank you!

Hi! I'm trying to accomplish this task too with "Create a new account for an anonymous order".

I've created a model for testing, but I'm not able to get the user.

The model starts with the event Checkout: Completion but when I try to access the user, it hasn't been created yet as it's mentioned in #5. It seems it's created after the checkout complete, so I cannot reference the user yet to add a role or (in my case) including it in a Group.

The order part and the group part are set, but I need to reach the user.

Production build 0.71.5 2024