-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrestaStructs.cpp
101 lines (93 loc) · 2.27 KB
/
PrestaStructs.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "PrestaStructs.h"
using namespace Presta;
Product::Product() :
id(0),
active(0),
show_price(0),
available_for_order(0),
id_category_default(0),
out_of_stock(2),
//quantity(0),
price(0)
{}
unsigned Product::getId(QDomDocument &doc) {
QDomElement prestashop = doc.firstChildElement("prestashop");
if(!prestashop.isNull()) {
QDomElement product = prestashop.firstChildElement("product");
if(!product.isNull()) {
return product.firstChildElement("id").firstChild().toCDATASection().nodeValue().toUInt();
} else return 0;
} else return 0;
}
SpecificPrice::SpecificPrice() :
id(0),
id_product(0),
id_shop(0),
id_cart(0),
id_currency(0),
id_country(0),
id_group(0),
id_customer(0),
price(0),
reduction(0),
from_quantity(0),
from("0000-00-00 00:00:00"),
to("0000-00-00 00:00:00"),
reduction_type(AMOUNT)
{}
Order::Order() :
id(0),
current_state(0),
id_address_delivery(0),
id_address_invoice(0),
id_cart(0),
id_currency(0),
id_lang(0),
id_customer(0),
id_carrier(0),
invoice_number(0),
delivery_number(0),
valid(0),
id_shop_group(0),
id_shop(0),
recyclable(0),
gift(0),
shipping_number(0),
total_discounts(0),
total_paid(0),
total_paid_real(0),
total_products(0),
total_products_wt(0),
total_shipping(0),
carrier_tax_rate(0),
total_wrapping(0),
conversion_rate(0),
total_discounts_tax_incl(0),
total_discounts_tax_excl(0),
total_paid_tax_incl(0),
total_paid_tax_excl(0),
total_shipping_tax_incl(0),
total_shipping_tax_excl(0),
total_wrapping_tax_incl(0),
total_wrapping_tax_excl(0)
{}
OrderHeader::OrderHeader() :
id(0),
current_state(0),
total_paid(0)
{}
Category::Category() :
id(0),
idRef(0),
active(1),
id_parent(1)
{}
uint Category::getId(QDomDocument &doc) {
QDomElement prestashop = doc.firstChildElement("prestashop");
if(!prestashop.isNull()) {
QDomElement category = prestashop.firstChildElement("category");
if(!category.isNull()) {
return category.firstChildElement("id").firstChild().toCDATASection().nodeValue().toUInt();
} else return 0;
} else return 0;
}