[API] Add locale to cart serialization + minor fixes

This commit is contained in:
Łukasz 2017-02-07 10:05:10 +01:00
parent 9fc6f7f37a
commit 51ea70294f
16 changed files with 28 additions and 14 deletions

View file

@ -607,17 +607,17 @@ Definition
PUT /api/v1/carts/{cartId}/items/{id}
+---------------+----------------+-------------------------------------------------------------+
| Parameter | Parameter type | Description |
+===============+================+=============================================================+
| Authorization | header | Token received during authentication |
+---------------+----------------+-------------------------------------------------------------+
| cartId | url attribute | Id of the requested cart |
+---------------+----------------+-------------------------------------------------------------+
| cartItemId | url attribute | Id of the requested cart item |
+---------------+----------------+-------------------------------------------------------------+
| quantity | request | Amount of items you want to add to the cart (cannot be < 1) |
+---------------+----------------+-------------------------------------------------------------+
+---------------+----------------+--------------------------------------------------------------+
| Parameter | Parameter type | Description |
+===============+================+==============================================================+
| Authorization | header | Token received during authentication |
+---------------+----------------+--------------------------------------------------------------+
| cartId | url attribute | Id of the requested cart |
+---------------+----------------+--------------------------------------------------------------+
| cartItemId | url attribute | Id of the requested cart item |
+---------------+----------------+--------------------------------------------------------------+
| quantity | request | Amount of items you want to have in the cart (cannot be < 1) |
+---------------+----------------+--------------------------------------------------------------+
Example
^^^^^^^

View file

@ -1,8 +1,8 @@
* :doc:`/api/introduction`
* :doc:`/api/authorization`
* :doc:`/api/channels`
* :doc:`/api/orders`
* :doc:`/api/carts`
* :doc:`/api/orders`
* :doc:`/api/checkouts`
* :doc:`/api/products`
* :doc:`/api/product_variants`

View file

@ -26,8 +26,6 @@ sylius_grid:
type: string
sortable: customer.email
path: customer.email
options:
template: "@SyliusAdmin/Order/Grid/Field/customer.html.twig"
total:
type: integer
sortable: total

View file

@ -10,6 +10,10 @@ Sylius\Component\Core\Model\Order:
expose: true
type: string
groups: [Default, Detailed, DetailedCart]
localeCode:
expose: true
type: string
groups: [Default, Detailed, DetailedCart]
shippingAddress:
expose: true
groups: [Detailed]

View file

@ -27,6 +27,7 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
},
"quantity": 1,

View file

@ -27,6 +27,7 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
},
"quantity": 1,

View file

@ -27,6 +27,7 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
},
"quantity": 3,

View file

@ -86,5 +86,6 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
}

View file

@ -43,6 +43,7 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
}
]

View file

@ -25,5 +25,6 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
}

View file

@ -59,5 +59,6 @@
"payments": @array@,
"shipments": @array@,
"currency_code": "EUR",
"locale_code": "en_US",
"checkout_state": "addressed"
}

View file

@ -41,5 +41,6 @@
"payments": @array@,
"shipments": @array@,
"currency_code": "EUR",
"locale_code": "en_US",
"checkout_state": "completed"
}

View file

@ -69,5 +69,6 @@
],
"shipments": @array@,
"currency_code": "EUR",
"locale_code": "en_US",
"checkout_state": "payment_selected"
}

View file

@ -77,5 +77,6 @@
}
],
"currency_code": "EUR",
"locale_code": "en_US",
"checkout_state": "shipping_selected"
}

View file

@ -38,6 +38,7 @@
}
},
"currency_code": "USD",
"locale_code": "en_US",
"payments": [],
"shipments": [],
"checkout_state": "cart"

View file

@ -40,5 +40,6 @@
"payments": [],
"shipments": [],
"currency_code": "USD",
"locale_code": "en_US",
"checkout_state": "cart"
}