ikismail/Angular-ShoppingCart

[BUG]unable to checkout products

buddhikavidra opened this issue · 2 comments

after filing shipping details and clicking "continue to checkout" button not redirects to a confirmation page

Steps to reproduce the behaviour

  1. Go to 'cart'
  2. Click on 'checkout'
  3. Click on 'next'
  4. fill shipping details

Expected behaviour
need to go success page

Screenshot (62)

Kuncy commented

core.js:6228 ERROR TypeError: Cannot read property 'emailId' of undefined
at ShippingDetailsComponent_Template (shipping-details.component.html:49)
at executeTemplate (core.js:12156)
at refreshView (core.js:11995)
at refreshComponent (core.js:13445)
at refreshChildComponents (core.js:11716)
at refreshView (core.js:12051)
at refreshEmbeddedViews (core.js:13391)
at refreshView (core.js:12022)
at refreshComponent (core.js:13445)
at refreshChildComponents (core.js:11716)
defaultErrorLogger @ core.js:6228
handleError @ core.js:6281
(anonymous) @ core.js:43145
invoke @ zone-evergreen.js:364
run @ zone-evergreen.js:123
runOutsideAngular @ core.js:41488
tick @ core.js:43142
(anonymous) @ core.js:42975
invoke @ zone-evergreen.js:364
onInvoke @ core.js:41654
invoke @ zone-evergreen.js:363
run @ zone-evergreen.js:123
run @ core.js:41427
next @ core.js:42971
schedulerFn @ core.js:37119
__tryOrUnsub @ Subscriber.js:183
next @ Subscriber.js:122
_next @ Subscriber.js:72
next @ Subscriber.js:49
next @ Subject.js:39
emit @ core.js:37079
checkStable @ core.js:41566
onHasTask @ core.js:41675
hasTask @ zone-evergreen.js:419
_updateTaskCount @ zone-evergreen.js:440
_updateTaskCount @ zone-evergreen.js:263
runTask @ zone-evergreen.js:184
drainMicroTaskQueue @ zone-evergreen.js:569
invokeTask @ zone-evergreen.js:484
invokeTask @ zone-evergreen.js:1621
globalZoneAwareCallback @ zone-evergreen.js:1647

Thats probably the problem, you get this error if you go to the checkout page.

Kuncy commented

The main problem is in the shipping-details.component.ts

authService.user$.pipe(

  map((user) => {
    
    this.userDetails = user;
    console.log(user);
  })
);

We get nothing here if you console log the user or the userDetail like i did, you get undefined back.
So probably there is a problem with the ngmodels in the html i think.