subscribepro-magento2-ext icon indicating copy to clipboard operation
subscribepro-magento2-ext copied to clipboard

Handle M2 customer deleted, SP customer not deleted, new M2 customer created

Open chrismshea opened this issue 1 year ago • 4 comments

PRs: #246

Steps to reproduce:

  • A customer can request their account to be deleted on Magento.
  • They can then create a new account using the same email address.
  • When they create a new subscription they will have created it for a customer in SP that has their old ID.
  • We then do the reorder, and attempt to create a cart using the old customer id.

Expected:

  • When they create a new subscription, new SP customer record is created
  • Old SP customer record gets marked as orphaned, email is changed to: Cur. Email + "-ORPHANED-" + unique ID
  • New SP customer record gets their new email and new M2 customer ID

Algorithm

  • Lookup SP Customer based on M2 customer ID
    • If found, use it
    • If not found
      • Lookup SP customer based on customer email
        • If not found, create new customer
        • If found
          • Update existing SP customer record, change email to: Cur. Email + "-ORPHANED-" + unique ID
          • Create new customer

chrismshea avatar Oct 27 '23 13:10 chrismshea