问题描述
在 WooCommerce 中添加到购物车的网址如下:// Note the first arg,you were missing it
mockReportService = jasmine.createSpyObj(ReportService,['getReport']);
// Then,explain what to do with it :
beforeEach(() => {
[...]
// When called,make it return an Observable so that the call to subscribe() succeeds
mockReportService.getReport.and.returnValue(of({}));
fixture.detectChanges();
});
是否有类似 wix 的添加到购物车网址的功能,就像我们在 WooCommerce 中所做的那样?
解决方法
好吧,您拥有 addToCart() API
您可以在单独的页面上使用一些逻辑来检索使用 Wix Location 的 query function 的 URL 值并将商品添加到购物车,但这可能需要更多的处理时间。