toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['product_id'] = this.productId;
data['variation_id'] = this.variationId;
data['quantity'] = this.quantity;
data['tax_class'] = this.taxClass;
data['subtotal'] = this.subtotal;
data['subtotal_tax'] = this.subtotalTax;
data['total'] = this.total;
data['total_tax'] = this.totalTax;
if (this.taxes != null) {
data['taxes'] = this.taxes!.map((v) => v.toJson()).toList();
}
if (this.metaData != null) {
data['meta_data'] = this.metaData!.map((v) => v.toJson()).toList();
}
data['sku'] = this.sku;
data['price'] = this.price;
return data;
}