Products


Overview

The products API allows you to view individual or a batch of products.


List all products

Returns products back from WooCommerce, include parementers to query data.

getProducts()

Parameters

    int page,
    int perPage,
    String search,
    String after,
    String before,
    String order,
    String orderBy,
    String slug,
    String status,
    String type,
    String sku,
    String category,
    String tag,
    String shippingClass,
    String attribute,
    String attributeTerm,
    String taxClass,
    String minPrice,
    String maxPrice,
    String stockStatus,
    List<int> exclude,
    List<int> parentExclude,
    List<int> include,
    List<int> parent,
    int offset = 0,
    bool featured,
    bool onSale

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

    wcStore.getProducts().then( (products) {
        print(products[0].name);
    });

});

Response

List<Product> instance

Represents the following object - WooCommerce list all products


Retrive a product

Returns a product back from WooCommerce, include parementers to query data.

getProductsForId({id:"product id"})

Parameters

    int id

API Call

// CONFIG FOR WOOSIGNAL
var wsConfig = {
"appKey":"your app key",
"debugMode":true
};

// CREATING AN INSTANCE
WooSignal.getInstance(config: wsConfig).then( (wcStore) {

    wcStore.getProductsForId({id: 2}).then((product){
        print(product.name);
    });

});

Response

Product instance

Represents the following object - WooCommerce retrieve a product