toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'id': id,
      'name': name,
      'slug': slug,
      'permalink': permalink,
      'type': type,
      'status': status,
      'featured': featured,
      'catalog_visibility': catalogVisibility,
      'description': description,
      'short_description': shortDescription,
      'sku': sku,
      'price': price,
      'regular_price': regularPrice,
      'sale_price': salePrice,
      'price_html': priceHtml,
      'on_sale': onSale,
      'purchasable': purchasable,
      'total_sales': totalSales,
      'virtual': virtual,
      'downloadable': downloadable,
      'downloads': downloads.map((i) => i.toJson()).toList(),
      'download_limit': downloadLimit,
      'download_expiry': downloadExpiry,
      'external_url': externalUrl,
      'button_text': buttonText,
      'tax_status': taxStatus,
      'tax_class': taxClass,
      'manage_stock': manageStock,
      'stock_quantity': stockQuantity,
      'stock_status': stockStatus,
      'backorders': backorders,
      'backorders_allowed': backordersAllowed,
      'backordered': backordered,
      'sold_individually': soldIndividually,
      'weight': weight,
      'dimensions': dimensions.toJson(),
      'shipping_required': shippingRequired,
      'shipping_taxable': shippingTaxable,
      'shipping_class': shippingClass,
      'shipping_class_id': shippingClassId,
      'reviews_allowed': reviewsAllowed,
      'average_rating': averageRating,
      'rating_count': ratingCount,
      'related_ids': relatedIds,
      'upsell_ids': upsellIds,
      'cross_sell_ids': crossSellIds,
      'parent_id': parentId,
      'purchase_note': purchaseNote,
      'categories': categories.map((i) => i.toJson()).toList(),
      'tags': tags.map((i) => i.toJson()).toList(),
      'images': images.map((i) => i.toJson()).toList(),
      'attributes': attributes.map((i) => i.toJson()).toList(),
      'default_attributes': defaultAttributes.map((i) => i.toJson()).toList(),
      'variations': variations,
      'grouped_products': groupedProducts,
      'menu_order': menuOrder,
      'meta_data': metaData.map((i) => i.toJson()).toList(),
      'date_created': dateCreated,
      'date_created_gmt': dateCreatedGMT,
    };