简体   繁体   English

斯巴达克斯导航到页面

[英]Spartacus navigate to page

I created an Order History custom page with a button to "Reorder" a cart.我创建了一个带有“重新订购”购物车按钮的订单历史自定义页面。 After reorder the cart I want to navigate to the cart page but I'm redirected back to my page with a "No Authorization" message.重新订购购物车后,我想导航到购物车页面,但我被重定向回我的页面,并显示“无授权”消息。 在此处输入图像描述 This is what I use to navigate这是我用来导航的

location.reload(); // refresh cart

this.routingService.go('cart');

If I go to the page through the cart icon everything works ok.如果我通过购物车图标 go 到页面,一切正常。 What I'm missing?我错过了什么?

Cart not found未找到购物车

happens if no cart exists in Backoffice.如果 Backoffice 中不存在购物车,则会发生这种情况。

you should refresh the cart with this.multiCartService.reloadCart(cartId) instead of reloading the page.您应该使用this.multiCartService.reloadCart(cartId)刷新购物车,而不是重新加载页面。

location.reload(); reloads the current URL.重新加载当前的 URL。 You can try to remove it, and just go to cart page by this.routingService.go('cart');您可以尝试将其删除,然后通过this.routingService.go('cart'); . .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM