Skip to content

Commit

Permalink
fix(storefront): Setting unlogged customer data for purchase event on…
Browse files Browse the repository at this point in the history
… vbeta app

Last try by `window.storefrontApp.customer` even if customer unset on `ecomPassport`
  • Loading branch information
leomp12 committed Aug 6, 2024
1 parent 0347bf8 commit dd85653
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/storefront/src/lib/scripts/vbeta-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ const watchAppRoutes = () => {
let buyer = order?.buyers?.[0] || customer.value;
if (!buyer?.main_email) {
try {
const _customer = (window as any).ecomPassport?.getCustomer();
let _customer = (window as any).ecomPassport?.getCustomer();
if (!_customer?.main_email) {
_customer = (window as any).storefrontApp?.customer;
}
if (_customer?.main_email) {
if (!buyer) buyer = {};
Object.assign(buyer, _customer);
Expand Down

0 comments on commit dd85653

Please sign in to comment.