From 8899052cef9b4e8d2682279ab9bc2d3ae09cb0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 13 May 2023 18:06:01 +0800 Subject: Function for updating quantity --- interchange/ord.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'interchange/ord.h') diff --git a/interchange/ord.h b/interchange/ord.h index 16c4e64..fa55da1 100644 --- a/interchange/ord.h +++ b/interchange/ord.h @@ -37,6 +37,18 @@ extern "C" { void interchange_ord_order(const char *sku, void (*handler)(interchange_response *)); +/*! + * \brief For updating the quantity of an item in a cart. + * \param name The name given, in the cart, to the item. + * \param quantity The desired quantity. + * \param orderpage The order page, by default it's ord/basket. + * \param nextpage The page to expect response from, whatever the result is. + * \param parser Function for parsing the formatted response. + */ +void interchange_ord_update(const char *name, const unsigned int quantity, + const char *orderpage, const char *nextpage, + void (*parser)(interchange_response *)); + /*! * \brief For removing an item from a cart. * \param name The name given, in the cart, to the item. @@ -44,8 +56,7 @@ void interchange_ord_order(const char *sku, * \param nextpage The page to expect response from, whatever the result is. * \param parser Function for parsing the formatted response. */ -void interchange_ord_remove(const char *name, const char *orderpage, - const char *nextpage, void (*parser)(interchange_response *)); +#define interchange_ord_remove(a, b, c, d) interchange_ord_update(a, 0, b, c, d) /*! * \brief For checking out items in the cart. -- cgit v1.2.3