checkout-sheet-kit-react-native icon indicating copy to clipboard operation
checkout-sheet-kit-react-native copied to clipboard

Cache or auto-reference to previously Identify Buyer (not logged in)

Open vanhai989 opened this issue 9 months ago • 3 comments

What area is the issue related to?

Checkout Sheet Kit

What platform does the issue affect?

All platforms

What version of @shopify/checkout-sheet-kit are you using?

3.2.0

Do you have reproducible example code?

import {ColorScheme, ShopifyCheckoutSheet} from '@shopify/checkout-sheet-kit';

const config = {};

export const shopifyCheckout = new ShopifyCheckoutSheet({
  ...config
});

export class SheetKit {

  constructor() {
    this.init()
  }

  shopifyCheckout = null

  init = () => {
    this.shopifyCheckout = new ShopifyCheckoutSheet({
      ...config
    });

    this.shopifyCheckout.addEventListener('close', () => {
    })

    this.shopifyCheckout.addEventListener('error', (error) => {
      console.log('error', error);
    })

    this.shopifyCheckout.addEventListener('pixel', (pixel) => {
    })

    this.shopifyCheckout.addEventListener('completed', (event) => {
      console.log('event', event);
    })
  }
}

// Create cart

   const handleCreateCart = async (email, customerAccessToken, isStoreCartID = true) => {
        const { data: createCartData, error } = await createCart({
            variables: {
                input: {
                    buyerIdentity: { 
                        email: email || undefined , 
                        customerAccessToken: customerAccessToken || undefined
                    },
                    attributes: cartDiscountAttribute.customAttributes,
                }
            }
        })}


// call checkout function
    Identify.sheetKit.shopifyCheckout.present(cartStore.checkoutUrl);

Steps to Reproduce

step 1. login with an account A, create cart with it's email + accesstoken step 2. checkout by checkout-sheet-kit (correct buyer information, email and addresses) step 3. logout -> create new cart with undefined email and undefined accesstoken step 4. checkout by checkout-sheet-kit (it auto-filled previous buyer infomation)

Expected Behavior

expected no-cache and no auto-fill with guest user

Actual Behavior

cached or auto-reference to previous buyer checkout when checkout with new guest cart

Storefront domain

non domain related

Screenshots/Videos/Log output

non media related

vanhai989 avatar Apr 11 '25 15:04 vanhai989

Hi, can I check if you're using legacy or new customer accounts (https://help.shopify.com/en/manual/customers/customer-accounts)?

kiftio avatar Apr 17 '25 10:04 kiftio

Hi, can I check if you're using legacy or new customer accounts (https://help.shopify.com/en/manual/customers/customer-accounts)? Yes, I'm using new customer accounts

haipv01 avatar Apr 23 '25 10:04 haipv01

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in 30 days. Thank you for your contributions.

github-actions[bot] avatar May 24 '25 03:05 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please re-open it if it is still relevant.

github-actions[bot] avatar May 31 '25 03:05 github-actions[bot]