From 4c43c27774cfc3652ff3269519ee248e71b58185 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: Fri, 16 Jun 2023 15:40:24 +0800 Subject: Item is now a subclass of Product --- interchange/product.hxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'interchange/product.hxx') diff --git a/interchange/product.hxx b/interchange/product.hxx index d3246ed..9fd7a89 100644 --- a/interchange/product.hxx +++ b/interchange/product.hxx @@ -25,9 +25,12 @@ namespace QInterchange { }; Product() {} - Product(struct interchange_product *product) : - price{product->price}, - weight{product->weight} + Product(struct interchange_product *product) + { + init(product); + } + + void init(struct interchange_product *product) { if (product->sku) sku = QString{product->sku}; @@ -41,10 +44,12 @@ namespace QInterchange { thumb = QString{product->thumb}; if (product->image) image = QString{product->image}; + price = product->price; if (product->prod_group) prodGroup = QString{product->prod_group}; if (product->category) category = QString{product->category}; + weight = product->weight; if (product->option_type) optionType = QString{product->option_type}; if (product->author) -- cgit v1.2.3