How to Attach Customer ID to Orders?
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- PaoloLegaspi
- Posts: 24
- Joined: 07 Nov 2024, 15:02
How to Attach Customer ID to Orders?
Hi,
We're trying to display customer orders on the profile page, but it's returning null. We discovered that customer IDs are not being attached to the order data when a user places an order, so they aren't saved in the database. How can we ensure the customer ID is linked to the order? We are using Jsonapi
Thanks!
We're trying to display customer orders on the profile page, but it's returning null. We discovered that customer IDs are not being attached to the order data when a user places an order, so they aren't saved in the database. How can we ensure the customer ID is linked to the order? We are using Jsonapi
Thanks!
Code: Select all
Aimeos version: Aimeos Headless 2024.07.*
PHP version: 8.2
Environment: Mac
- PaoloLegaspi
- Posts: 24
- Joined: 07 Nov 2024, 15:02
Re: How to Attach Customer ID to Orders?
In our checkout flow (using JSON:API):
1. The customer logs in. (JWT auth)
2. They add products to the basket. (Gets added to basket)
3. The customer provides a delivery address. (Gets added to basket)
4. The customer provides a payment address. (Gets added to basket)
5. They pick a payment service and delivery service. (Gets added to basket)
6. Finally, they place the order and get redirected to payment (Montonio).
For some reason, the customerid isn’t getting attached to the created orders, and I’m not sure what we’re missing or doing wrong. Any ideas?
1. The customer logs in. (JWT auth)
2. They add products to the basket. (Gets added to basket)
3. The customer provides a delivery address. (Gets added to basket)
4. The customer provides a payment address. (Gets added to basket)
5. They pick a payment service and delivery service. (Gets added to basket)
6. Finally, they place the order and get redirected to payment (Montonio).
For some reason, the customerid isn’t getting attached to the created orders, and I’m not sure what we’re missing or doing wrong. Any ideas?
Re: How to Attach Customer ID to Orders?
Can you please upgrade to 2024.10 and then, execute:
This commit should add the customer ID automatically to the order now:
https://github.com/aimeos/ai-client-jso ... b817edaf36
Code: Select all
composer req aimeos/ai-cient-jsonapi:2024.10.x-dev
https://github.com/aimeos/ai-client-jso ... b817edaf36
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star