public static class Storefront.ProductVariant extends <any> implements Storefront.HasMetafields, Storefront.MetafieldParentResource, Storefront.Node
| Constructor and Description |
|---|
ProductVariant() |
ProductVariant(ID id) |
ProductVariant(JsonObject fields) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Boolean |
getAvailable()
Deprecated.
Use `availableForSale` instead
|
java.lang.Boolean |
getAvailableForSale()
Indicates if the product variant is available for sale.
|
java.math.BigDecimal |
getCompareAtPrice()
Deprecated.
Use `compareAtPriceV2` instead
|
Storefront.MoneyV2 |
getCompareAtPriceV2()
The compare at price of the variant.
|
java.lang.Boolean |
getCurrentlyNotInStock()
Whether a product is out of stock but still available for purchase (used for backorders).
|
java.lang.String |
getGraphQlTypeName() |
ID |
getId()
Globally unique identifier.
|
Storefront.Image |
getImage()
Image associated with the product variant.
|
Storefront.Metafield |
getMetafield()
The metafield associated with the resource.
|
Storefront.MetafieldConnection |
getMetafields()
A paginated list of metafields associated with the resource.
|
Storefront.ProductVariantPricePairConnection |
getPresentmentPrices()
List of prices and compare-at prices in the presentment currencies for this shop.
|
Storefront.MoneyV2Connection |
getPresentmentUnitPrices()
List of unit prices in the presentment currencies for this shop.
|
java.math.BigDecimal |
getPrice()
Deprecated.
Use `priceV2` instead
|
Storefront.MoneyV2 |
getPriceV2()
The product variant’s price.
|
Storefront.Product |
getProduct()
The product object that the product variant belongs to.
|
java.lang.Integer |
getQuantityAvailable()
The total sellable quantity of the variant for online sales channels.
|
java.lang.Boolean |
getRequiresShipping()
Whether a customer needs to provide a shipping address when placing an order for the product
variant.
|
java.util.List<Storefront.SelectedOption> |
getSelectedOptions()
List of product options applied to the variant.
|
java.lang.String |
getSku()
The SKU (stock keeping unit) associated with the variant.
|
java.lang.String |
getTitle()
The product variant’s title.
|
Storefront.MoneyV2 |
getUnitPrice()
The unit price value for the variant based on the variant's measurement.
|
Storefront.UnitPriceMeasurement |
getUnitPriceMeasurement()
The unit price measurement for the variant.
|
java.lang.Double |
getWeight()
The weight of the product variant in the unit system specified with `weight_unit`.
|
Storefront.WeightUnit |
getWeightUnit()
Unit of measurement for weight.
|
Storefront.ProductVariant |
setAvailable(java.lang.Boolean arg) |
Storefront.ProductVariant |
setAvailableForSale(java.lang.Boolean arg) |
Storefront.ProductVariant |
setCompareAtPrice(java.math.BigDecimal arg) |
Storefront.ProductVariant |
setCompareAtPriceV2(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setCurrentlyNotInStock(java.lang.Boolean arg) |
Storefront.ProductVariant |
setImage(Storefront.Image arg) |
Storefront.ProductVariant |
setMetafield(Storefront.Metafield arg) |
Storefront.ProductVariant |
setMetafields(Storefront.MetafieldConnection arg) |
Storefront.ProductVariant |
setPresentmentPrices(Storefront.ProductVariantPricePairConnection arg) |
Storefront.ProductVariant |
setPresentmentUnitPrices(Storefront.MoneyV2Connection arg) |
Storefront.ProductVariant |
setPrice(java.math.BigDecimal arg) |
Storefront.ProductVariant |
setPriceV2(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setProduct(Storefront.Product arg) |
Storefront.ProductVariant |
setQuantityAvailable(java.lang.Integer arg) |
Storefront.ProductVariant |
setRequiresShipping(java.lang.Boolean arg) |
Storefront.ProductVariant |
setSelectedOptions(java.util.List<Storefront.SelectedOption> arg) |
Storefront.ProductVariant |
setSku(java.lang.String arg) |
Storefront.ProductVariant |
setTitle(java.lang.String arg) |
Storefront.ProductVariant |
setUnitPrice(Storefront.MoneyV2 arg) |
Storefront.ProductVariant |
setUnitPriceMeasurement(Storefront.UnitPriceMeasurement arg) |
Storefront.ProductVariant |
setWeight(java.lang.Double arg) |
Storefront.ProductVariant |
setWeightUnit(Storefront.WeightUnit arg) |
boolean |
unwrapsToObject(java.lang.String key) |
public ProductVariant()
public ProductVariant(JsonObject fields)
throws SchemaViolationError
SchemaViolationErrorpublic ProductVariant(ID id)
public java.lang.String getGraphQlTypeName()
getGraphQlTypeName in interface Storefront.HasMetafieldsgetGraphQlTypeName in interface Storefront.MetafieldParentResourcegetGraphQlTypeName in interface Storefront.Nodepublic java.lang.Boolean getAvailable()
public Storefront.ProductVariant setAvailable(java.lang.Boolean arg)
public java.lang.Boolean getAvailableForSale()
public Storefront.ProductVariant setAvailableForSale(java.lang.Boolean arg)
public java.math.BigDecimal getCompareAtPrice()
public Storefront.ProductVariant setCompareAtPrice(java.math.BigDecimal arg)
public Storefront.MoneyV2 getCompareAtPriceV2()
public Storefront.ProductVariant setCompareAtPriceV2(Storefront.MoneyV2 arg)
public java.lang.Boolean getCurrentlyNotInStock()
public Storefront.ProductVariant setCurrentlyNotInStock(java.lang.Boolean arg)
public ID getId()
getId in interface Storefront.Nodepublic Storefront.Image getImage()
public Storefront.ProductVariant setImage(Storefront.Image arg)
public Storefront.Metafield getMetafield()
getMetafield in interface Storefront.HasMetafieldspublic Storefront.ProductVariant setMetafield(Storefront.Metafield arg)
public Storefront.MetafieldConnection getMetafields()
getMetafields in interface Storefront.HasMetafieldspublic Storefront.ProductVariant setMetafields(Storefront.MetafieldConnection arg)
public Storefront.ProductVariantPricePairConnection getPresentmentPrices()
public Storefront.ProductVariant setPresentmentPrices(Storefront.ProductVariantPricePairConnection arg)
public Storefront.MoneyV2Connection getPresentmentUnitPrices()
public Storefront.ProductVariant setPresentmentUnitPrices(Storefront.MoneyV2Connection arg)
public java.math.BigDecimal getPrice()
public Storefront.ProductVariant setPrice(java.math.BigDecimal arg)
public Storefront.MoneyV2 getPriceV2()
public Storefront.ProductVariant setPriceV2(Storefront.MoneyV2 arg)
public Storefront.Product getProduct()
public Storefront.ProductVariant setProduct(Storefront.Product arg)
public java.lang.Integer getQuantityAvailable()
public Storefront.ProductVariant setQuantityAvailable(java.lang.Integer arg)
public java.lang.Boolean getRequiresShipping()
public Storefront.ProductVariant setRequiresShipping(java.lang.Boolean arg)
public java.util.List<Storefront.SelectedOption> getSelectedOptions()
public Storefront.ProductVariant setSelectedOptions(java.util.List<Storefront.SelectedOption> arg)
public java.lang.String getSku()
public Storefront.ProductVariant setSku(java.lang.String arg)
public java.lang.String getTitle()
public Storefront.ProductVariant setTitle(java.lang.String arg)
public Storefront.MoneyV2 getUnitPrice()
public Storefront.ProductVariant setUnitPrice(Storefront.MoneyV2 arg)
public Storefront.UnitPriceMeasurement getUnitPriceMeasurement()
public Storefront.ProductVariant setUnitPriceMeasurement(Storefront.UnitPriceMeasurement arg)
public java.lang.Double getWeight()
public Storefront.ProductVariant setWeight(java.lang.Double arg)
public Storefront.WeightUnit getWeightUnit()
public Storefront.ProductVariant setWeightUnit(Storefront.WeightUnit arg)
public boolean unwrapsToObject(java.lang.String key)