summaryrefslogtreecommitdiff
path: root/interchange/product.hxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-16 15:40:24 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-16 15:40:24 +0800
commit4c43c27774cfc3652ff3269519ee248e71b58185 (patch)
treebe2c03a23347033a16926e236d0af93d8ca27d7f /interchange/product.hxx
parentd0a8570fd5c46ad2cab21af0b8f5a299bcbc1792 (diff)
Item is now a subclass of Product
Diffstat (limited to 'interchange/product.hxx')
-rw-r--r--interchange/product.hxx11
1 files changed, 8 insertions, 3 deletions
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)