UNPKG

@shopgate/pwa-common-commerce

Version:

Commerce library for the Shopgate Connect PWA.

1 lines 2.04 kB
function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}var emptyState={cart:{items:[],totals:[{label:null,amount:0,type:'subTotal'},{label:null,amount:0,type:'grandTotal'}],productPendingCount:0,flags:{orderable:true,taxIncluded:false,coupons:true},isFetching:false,expires:0,isOrderable:true,isTaxIncluded:false,currency:'USD',messages:[],text:{legalText:'By placing your order you agree to our <b><u>Privacy Policy</u></b> and our <b><u>Terms and Conditions</u></b>.',legalInfo:''}},view:{isLoading:false},client:{device:{locale:'de',model:'Redmi Note 4',os:{apiLevel:'23',platform:'android',ver:'6.0'},type:'phone'}},router:{routing:false,stack:[{id:'82588781-089a-46bc-8174-7cebfae12d95',params:{},pathname:'/',pattern:'/',query:{},state:{}},{id:'834a9c2f-c94d-441d-aba5-446a7895d724',params:{},pathname:'/cart',pattern:'/cart',query:{},state:{title:'Shopping cart'}}]}};var products=[{id:'123',quantity:1,type:'product',product:{id:'test_product',name:'Test Product',featuredImageBaseUrl:'https://img-cdn.shopgate.com/30794/1/d11b2e01b66f7a505fbd98b6ed7463c092aeaebae11ee8bec20ffc13344297fa',featuredImageUrl:'https://img-cdn.shopgate.com/30794/1/d11b2e01b66f7a505fbd98b6ed7463c092aeaebae11ee8bec20ffc13344297fa',price:{unit:20,"default":20,special:null},properties:[{label:'Weight',value:'15kg'}],appliedDiscounts:[]},coupon:null,messages:[]}];var coupon={id:'234',quantity:1,type:'coupon',coupon:{code:'FOREVER',description:null,label:'Coupon',savedPrice:{value:5,type:'fixed'}},messages:[],product:null};var cartState=_extends({},emptyState,{},{cart:_extends({},emptyState.cart,{items:products})});var couponState=_extends({},emptyState,{},{cart:_extends({},emptyState.cart,{items:[].concat(products,[_extends({},coupon)])})});var uiState={ui:{general:{}}};export{uiState,emptyState,cartState,couponState};