ListItem
How a single cart line is rendered by the API: key, title, quantity, price and your own data.
Fields
The following fields are available in the ListItem model and can be fetched with the select parameter.
| Name | Return type |
|---|---|
| key | string |
| title | null or string |
| type | string |
| thumb | null or array |
| url | null or string |
| price | null or Wagnerwagner\Merx\Price |
| total | null or Wagnerwagner\Merx\Price |
| quantity | float |
| page | null or Kirby\Cms\Page |
| data | null or array |
Views
The following fields are available in the ListItem model and can be fetched with the view parameter.
| Name | Fields |
|---|---|
| compact | key, title, type, price, total, quantity |
| default | key, title, type, thumb, url, price, total, quantity, data, page<url, template, uuid> |
Type
Examples
The ListItem model of an example cart, in each of its views.
{
"data": {
"size": "42"
},
"key": "products/nice-shoes",
"page": {
"template": "product",
"url": "https://shop.test/products/nice-shoes",
"uuid": "page://Yk4fR7tNq2Lm9VxC"
},
"price": {
"price": "€89.90",
"priceIncludingTax": true,
"priceNet": "€75.55",
"priceNetRaw": 75.5499999999999971578290569595992565155029296875,
"priceRaw": 89.900000000000005684341886080801486968994140625,
"tax": {
"price": "€14.35",
"priceRaw": 14.3499999999999996447286321199499070644378662109375,
"rate": "19%",
"rateRaw": 0.190000000000000002220446049250313080847263336181640625
}
},
"quantity": 1,
"thumb": null,
"title": "Nice Shoes",
"total": {
"price": "€89.90",
"priceIncludingTax": true,
"priceNet": "€75.55",
"priceNetRaw": 75.5499999999999971578290569595992565155029296875,
"priceRaw": 89.900000000000005684341886080801486968994140625,
"tax": {
"price": "€14.35",
"priceRaw": 14.3499999999999996447286321199499070644378662109375,
"rate": "19%",
"rateRaw": 0.190000000000000002220446049250313080847263336181640625
}
},
"type": "product",
"url": "https://shop.test/products/nice-shoes"
}
{
"key": "products/nice-shoes",
"price": {
"price": "€89.90",
"priceIncludingTax": true,
"priceNet": "€75.55",
"priceNetRaw": 75.5499999999999971578290569595992565155029296875,
"priceRaw": 89.900000000000005684341886080801486968994140625,
"tax": {
"price": "€14.35",
"priceRaw": 14.3499999999999996447286321199499070644378662109375,
"rate": "19%",
"rateRaw": 0.190000000000000002220446049250313080847263336181640625
}
},
"quantity": 1,
"title": "Nice Shoes",
"total": {
"price": "€89.90",
"priceIncludingTax": true,
"priceNet": "€75.55",
"priceNetRaw": 75.5499999999999971578290569595992565155029296875,
"priceRaw": 89.900000000000005684341886080801486968994140625,
"tax": {
"price": "€14.35",
"priceRaw": 14.3499999999999996447286321199499070644378662109375,
"rate": "19%",
"rateRaw": 0.190000000000000002220446049250313080847263336181640625
}
},
"type": "product"
}