summaryrefslogtreecommitdiff
path: root/interchange/product.hxx
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-15 18:08:35 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-06-15 18:08:35 +0800
commitd0a8570fd5c46ad2cab21af0b8f5a299bcbc1792 (patch)
treea279d6903340ce0d3c7ab165a2fbd9ae7d73b5d8 /interchange/product.hxx
parentca179a4b0ed27a240bd3144a01e3c7ec13f75389 (diff)
Product is back constructed using pointers
so that Item can easily subclass from Product later.
Diffstat (limited to 'interchange/product.hxx')
-rw-r--r--interchange/product.hxx54
1 files changed, 27 insertions, 27 deletions
diff --git a/interchange/product.hxx b/interchange/product.hxx
index 8a46d89..d3246ed 100644
--- a/interchange/product.hxx
+++ b/interchange/product.hxx
@@ -25,37 +25,37 @@ namespace QInterchange {
};
Product() {}
- Product(struct interchange_product product) :
- price{product.price},
- weight{product.weight}
+ Product(struct interchange_product *product) :
+ price{product->price},
+ weight{product->weight}
{
- if (product.sku)
- sku = QString{product.sku};
- if (product.description)
- description = QString{product.description};
- if (product.title)
- title = QString{product.title};
- if (product.comment)
- comment = QString{product.comment};
- if (product.thumb)
- thumb = QString{product.thumb};
- if (product.image)
- image = QString{product.image};
- if (product.prod_group)
- prodGroup = QString{product.prod_group};
- if (product.category)
- category = QString{product.category};
- if (product.option_type)
- optionType = QString{product.option_type};
- if (product.author)
- author = QString{product.author};
- if (product.crosssell) {
- auto crosssell = product.crosssell;
+ if (product->sku)
+ sku = QString{product->sku};
+ if (product->description)
+ description = QString{product->description};
+ if (product->title)
+ title = QString{product->title};
+ if (product->comment)
+ comment = QString{product->comment};
+ if (product->thumb)
+ thumb = QString{product->thumb};
+ if (product->image)
+ image = QString{product->image};
+ if (product->prod_group)
+ prodGroup = QString{product->prod_group};
+ if (product->category)
+ category = QString{product->category};
+ if (product->option_type)
+ optionType = QString{product->option_type};
+ if (product->author)
+ author = QString{product->author};
+ if (product->crosssell) {
+ auto crosssell = product->crosssell;
for (size_t i = 0; i < crosssell->length; i++)
crossSell << QString{crosssell->skus[i]};
}
- if (product.image_large)
- imageLarge = QString{product.image_large};
+ if (product->image_large)
+ imageLarge = QString{product->image_large};
}
QString sku;