summaryrefslogtreecommitdiff
path: root/interchange
diff options
context:
space:
mode:
Diffstat (limited to 'interchange')
-rw-r--r--interchange/ord.hxx2
-rw-r--r--interchange/product.hxx54
2 files changed, 28 insertions, 28 deletions
diff --git a/interchange/ord.hxx b/interchange/ord.hxx
index 7728085..34ff202 100644
--- a/interchange/ord.hxx
+++ b/interchange/ord.hxx
@@ -15,7 +15,7 @@ namespace QInterchange {
NameRole
};
Item(interchange_ord_item item) :
- product{item.product},
+ product{&item.product},
quantity{item.quantity},
name{item.name} {}
Product product;
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;