2020-02-18 23:06:37 +00:00
/ * *
* External dependencies
* /
import { _ _ } from '@wordpress/i18n' ;
/ * *
* Internal dependencies
* /
import productPicture from './product-image' ;
2020-03-13 13:41:59 +00:00
import { previewShippingRates } from './shipping-rates' ;
2020-02-18 23:06:37 +00:00
// Sample data for cart block.
// This closely resembles the data returned from the Store API /cart endpoint.
// https://github.com/woocommerce/woocommerce-gutenberg-products-block/tree/master/src/RestApi/StoreApi#cart-api
export const previewCart = {
2020-03-13 13:41:59 +00:00
coupons : [ ] ,
shipping _rates : previewShippingRates ,
2020-02-18 23:06:37 +00:00
items : [
{
key : '1' ,
id : 1 ,
quantity : 2 ,
name : _ _ ( 'Beanie' , 'woo-gutenberg-products-block' ) ,
summary : _ _ (
'Warm hat for winter' ,
'woo-gutenberg-products-block'
) ,
short _description : _ _ (
'Warm hat for winter' ,
'woo-gutenberg-products-block'
) ,
description :
'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.' ,
sku : 'woo-beanie' ,
permalink : 'https://example.org' ,
low _stock _remaining : 2 ,
2020-03-10 15:14:05 +00:00
backorders _allowed : false ,
sold _individually : false ,
2020-02-18 23:06:37 +00:00
images : [
{
id : 10 ,
src : productPicture ,
thumbnail : productPicture ,
srcset : '' ,
sizes : '' ,
name : '' ,
alt : '' ,
} ,
] ,
variation : [
{
attribute : _ _ ( 'Color' , 'woo-gutenberg-products-block' ) ,
value : _ _ ( 'Yellow' , 'woo-gutenberg-products-block' ) ,
} ,
{
attribute : _ _ ( 'Size' , 'woo-gutenberg-products-block' ) ,
value : _ _ ( 'Small' , 'woo-gutenberg-products-block' ) ,
} ,
] ,
2020-02-25 12:17:13 +00:00
prices : {
currency _code : 'USD' ,
currency _symbol : '$' ,
currency _minor _unit : 2 ,
currency _decimal _separator : '.' ,
currency _thousand _separator : ',' ,
currency _prefix : '$' ,
currency _suffix : '' ,
price : '800' ,
regular _price : '800' ,
sale _price : '800' ,
2020-03-17 12:11:30 +00:00
line _price : '1600' ,
line _regular _price : '1600' ,
line _sale _price : '1600' ,
2020-02-25 12:17:13 +00:00
} ,
2020-02-18 23:06:37 +00:00
totals : {
currency _code : 'USD' ,
currency _symbol : '$' ,
currency _minor _unit : 2 ,
currency _decimal _separator : '.' ,
currency _thousand _separator : ',' ,
currency _prefix : '$' ,
currency _suffix : '' ,
2020-02-25 12:17:13 +00:00
line _subtotal : '1600' ,
2020-02-18 23:06:37 +00:00
line _subtotal _tax : '0' ,
2020-02-25 12:17:13 +00:00
line _total : '1600' ,
2020-02-18 23:06:37 +00:00
line _total _tax : '0' ,
} ,
} ,
{
key : '2' ,
id : 2 ,
quantity : 1 ,
name : _ _ ( 'Cap' , 'woo-gutenberg-products-block' ) ,
summary : _ _ (
'Lightweight baseball cap' ,
'woo-gutenberg-products-block'
) ,
short _description : _ _ (
'Lightweight baseball cap' ,
'woo-gutenberg-products-block'
) ,
description :
'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.' ,
sku : 'woo-cap' ,
permalink : 'https://example.org' ,
2020-03-10 15:14:05 +00:00
backorders _allowed : false ,
sold _individually : false ,
2020-02-18 23:06:37 +00:00
images : [
{
id : 11 ,
src : productPicture ,
thumbnail : productPicture ,
srcset : '' ,
sizes : '' ,
name : '' ,
alt : '' ,
} ,
] ,
variation : [
{
attribute : _ _ ( 'Color' , 'woo-gutenberg-products-block' ) ,
value : _ _ ( 'Orange' , 'woo-gutenberg-products-block' ) ,
} ,
] ,
2020-02-25 12:17:13 +00:00
prices : {
currency _code : 'USD' ,
currency _symbol : '$' ,
currency _minor _unit : 2 ,
currency _decimal _separator : '.' ,
currency _thousand _separator : ',' ,
currency _prefix : '$' ,
currency _suffix : '' ,
price : '1400' ,
regular _price : '1600' ,
sale _price : '1400' ,
2020-03-17 12:11:30 +00:00
line _price : '1400' ,
line _regular _price : '1600' ,
line _sale _price : '1400' ,
2020-02-25 12:17:13 +00:00
} ,
2020-02-18 23:06:37 +00:00
totals : {
currency _code : 'USD' ,
currency _symbol : '$' ,
currency _minor _unit : 2 ,
currency _decimal _separator : '.' ,
currency _thousand _separator : ',' ,
currency _prefix : '$' ,
currency _suffix : '' ,
2020-02-25 12:17:13 +00:00
line _subtotal : '1400' ,
2020-02-18 23:06:37 +00:00
line _subtotal _tax : '0' ,
line _total : '1400' ,
line _total _tax : '0' ,
} ,
} ,
] ,
2020-03-17 12:11:30 +00:00
items _count : 3 ,
2020-03-13 13:41:59 +00:00
items _weight : 0 ,
needs _shipping : true ,
2020-02-18 23:06:37 +00:00
totals : {
2020-03-13 13:41:59 +00:00
currency _code : 'USD' ,
currency _symbol : '$' ,
2020-02-18 23:06:37 +00:00
currency _minor _unit : 2 ,
2020-03-13 13:41:59 +00:00
currency _decimal _separator : '.' ,
currency _thousand _separator : ',' ,
currency _prefix : '$' ,
currency _suffix : '' ,
2020-02-25 12:17:13 +00:00
total _items : '3000' ,
2020-02-18 23:06:37 +00:00
total _items _tax : '0' ,
total _fees : '0' ,
total _fees _tax : '0' ,
total _discount : '0' ,
total _discount _tax : '0' ,
total _shipping : '0' ,
total _shipping _tax : '0' ,
total _tax : '0' ,
2020-02-25 12:17:13 +00:00
total _price : '3000' ,
2020-03-13 13:41:59 +00:00
tax _lines : [ ] ,
2020-02-18 23:06:37 +00:00
} ,
} ;