Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Using Address ID in subscription fields - how we can we update them all as part of the Craft 3 -> 4 Migration #3671

Open
terryupton opened this issue Sep 13, 2024 · 4 comments
Assignees
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce

Comments

@terryupton
Copy link

What happened?

Description

In a craft 3 commerce we have subscriptions and these generate new orders based on a schedule.
As part of this process, we currently store the address ID for billing and shipping addresses so that we can assign these when building new orders.

Screenshot 2024-09-12 at 17 11 11

With the Craft 3 to 4 Migration - all the addresses are migrated and created with new ID's,
so our old iDs stored against each subscription would now be dead/broken.

What is the solution for this?
Can we hook into the migration scripts or create our own to handle this?
Does Craft keep a log of old address IDS and new ones it migrates them to?
Is there a list of the original ID in the database?

We really need a solution as there are over 2 thousand subscriptions and each will have a Billing and Shipping ID.
It is a potentially blocker from upgrading at the moment, and I cannot see an easy path out of this.

As an example.
Previous address is: 190257 is now 311096
Previous address is: 135 is now 177320

There is no pattern to the new ID vs the old id (it hasn't increased by X amount for example).

Thanks.
Terry Upton

Craft CMS version

Craft Pro 4.12.2

Craft Commerce version

4.6.11

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@terryupton terryupton added bug commerce4 Issues related to Commerce v4 Craft Commerce labels Sep 13, 2024
@terryupton
Copy link
Author

Further issues regarding this address stuff, is that any existing orders built for subscriptions have no address data associated with them. I am unsure why this is? As they are still normal orders, but it must be something to do with the migration process and how Craft migrations run and re-link address information for orders.

Screenshot 2024-09-13 at 14 27 03

@lukeholder
Copy link
Member

Communicating about this issue in support channels.

@lukeholder lukeholder self-assigned this Sep 16, 2024
@terryupton
Copy link
Author

terryupton commented Oct 3, 2024

On further investigation, orders with the following status DID migrate the addresses for Subscription orders.

  • Cancelled
  • Full Refund
  • Partial Refund

It would appear that only orders with the 'Shipped' status did not migrate all the addresses, which is the status with the majority of the orders. is there any known bug around why certain status would not migrated addresses for Subscription orders? The addresses are migrated for manual orders. This is a real blocker at the moment and I can't upgrade without a solution or fix.

Issue has been reported to Pixel and Tonic and I am awaiting feedback.
Any thoughts on this @lukeholder ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4 Craft Commerce
Projects
None yet
Development

No branches or pull requests

2 participants