Product Variations


Overview

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


List all product variations

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

getProductVariations()

Parameters

int productId, 

int page,
int perPage,
String search,
String after,
String before,
List<int> exclude,
List<int> include,
int offset,
String order,
String orderBy,
List<int> parent,
List<int> parentExclude,
String slug,
String status,
String sku,
String taxClass,
bool onSale,
String minPrice,
String maxPrice,
String stockStatus

API Call

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

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

    wcStore.getProductVariations().then( (productVariations) {
        print(productVariations[0].price);
    });

});

Response

List<ProductVariation> instance

Represents the following object - WooCommerce list all product variations


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.then( (productVariation) {
        print(productVariation);
    });

});

Response

ProductVariation instance

Represents the following object - WooCommerce retrieve a product vartiation