toJson method
Implementation
Map<String, dynamic> toJson() {
final _data = <String, dynamic>{};
_data['id'] = id;
_data['name'] = name;
_data['slug'] = slug;
_data['stock_quantity'] = stockQuantity;
_data['sku'] = sku;
_data['upc'] = upc;
_data['is_active'] = isActive;
_data['is_featured'] = isFeatured;
_data['description'] = description;
_data['short_description'] = shortDescription;
_data['type'] = type;
_data['price'] = price;
_data['special_price'] = specialPrice;
_data['allow_subscription'] = allowSubscription;
_data['categories'] = categories.map((e) => e.toJson()).toList();
_data['tags'] = tags;
_data['product_images'] = productImages.map((e) => e.toJson()).toList();
_data['weight'] = weight;
_data['dimension'] = dimension;
_data['product_options'] = productOptions;
_data['store'] = store?.toJson();
_data['purchase_note'] = purchaseNote;
_data['upsell_products'] = upsellProducts;
_data['cross_sell_products'] = crossSellProducts;
_data['external_url'] = externalUrl;
_data['external_button_text'] = externalButtonText;
_data['formatted_prices'] = formattedPrices.toJson();
_data['additional'] = additional.toJson();
_data['created_at'] = createdAt;
_data['updated_at'] = updatedAt;
_data['url'] = url;
return _data;
}