Class: Falsify::ProductVariant

Inherits:
Object
  • Object
show all
Extended by:
Enumerize
Defined in:
lib/falsify/models/product/product_variant.rb

Overview

A variant can be added to a Product resource to represent one version of a product with several options.

See the API documentation.

Instance Attribute Summary collapse

Instance Attribute Details

#barcode ⇒ String

The barcode, UPC, or ISBN number for the product.

Returns:

  • (String)


11
12
13
# File 'lib/falsify/models/product/product_variant.rb', line 11

def barcode
  @barcode
end

#compare_at_price ⇒ String

The original price of the item before an adjustment or a sale.

Returns:

  • (String)


14
15
16
# File 'lib/falsify/models/product/product_variant.rb', line 14

def compare_at_price
  @compare_at_price
end

#created_at ⇒ String

The date and time (ISO 8601 format) when the product variant was created.

Returns:

  • (String)


17
18
19
# File 'lib/falsify/models/product/product_variant.rb', line 17

def created_at
  @created_at
end

#fulfillment_service ⇒ String

The fulfillment service associated with the product variant. Valid values: manual or the handle of a fulfillment service.

Returns:

  • (String)


21
22
23
# File 'lib/falsify/models/product/product_variant.rb', line 21

def fulfillment_service
  @fulfillment_service
end

#grams ⇒ String

The weight of the product variant in grams.

Returns:

  • (String)


24
25
26
# File 'lib/falsify/models/product/product_variant.rb', line 24

def grams
  @grams
end

#id ⇒ String

The unique numeric identifier for the product variant.

Returns:

  • (String)


27
28
29
# File 'lib/falsify/models/product/product_variant.rb', line 27

def id
  @id
end

#image_id ⇒ String

The unique numeric identifier for a product's image. The image must be associated to the same product as the variant.

Returns:

  • (String)


31
32
33
# File 'lib/falsify/models/product/product_variant.rb', line 31

def image_id
  @image_id
end

#inventory_item_id ⇒ String

The unique identifier for the inventory item, which is used in the Inventory API to query for inventory information.

Returns:

  • (String)


34
35
36
# File 'lib/falsify/models/product/product_variant.rb', line 34

def inventory_item_id
  @inventory_item_id
end

#inventory_management ⇒ String

The fulfillment service that tracks the number of items in stock for the product variant. If you track the inventory yourself using the admin, then set the value to "shopify". Valid values: shopify or the handle of a fulfillment service that has inventory management enabled. Must be the same fulfillment service referenced by the fulfillment_service property.

Returns:

  • (String)


40
41
42
# File 'lib/falsify/models/product/product_variant.rb', line 40

def inventory_management
  @inventory_management
end

#inventory_policy ⇒ :deny, :continue

Whether customers are allowed to place an order for the product variant when it's out of stock. Valid values:

  • deny - Customers are not allowed to place orders for the product variant if it's out of stock.
  • continue - Customers are allowed to place orders for the product variant if it's out of stock.

Returns:

  • (:deny, :continue)


47
# File 'lib/falsify/models/product/product_variant.rb', line 47

enumerize :inventory_policy, in: [:deny, :continue]

#inventory_quantity ⇒ String (readonly)

An aggregate of inventory across all locations. To adjust inventory at a specific location, use the InventoryLevel resource.

Returns:

  • (String)


51
52
53
# File 'lib/falsify/models/product/product_variant.rb', line 51

def inventory_quantity
  @inventory_quantity
end

#inventory_quantity_adjustment ⇒ Integer

Deprecated.

Use the InventoryLevel resource instead.

Returns:

  • (Integer)


57
58
59
# File 'lib/falsify/models/product/product_variant.rb', line 57

def inventory_quantity_adjustment
  @inventory_quantity_adjustment
end

#old_inventory_quantity ⇒ Integer

Deprecated.

Use the InventoryLevel resource instead.

Returns:

  • (Integer)


54
55
56
# File 'lib/falsify/models/product/product_variant.rb', line 54

def old_inventory_quantity
  @old_inventory_quantity
end

#option ⇒ String

The custom properties that a shop owner uses to define product variants. You can define three options for a product: option1, option2, option3. Default value: Default Title.

Returns:

  • (String)


62
63
64
# File 'lib/falsify/models/product/product_variant.rb', line 62

def option
  @option
end

#position ⇒ Integer (readonly)

The order of the product variant in the list of product variants. The first position in the list is 1. The position of variants is indicated by the order in which they are listed.

Returns:

  • (Integer)


73
74
75
# File 'lib/falsify/models/product/product_variant.rb', line 73

def position
  @position
end

#presentment_prices ⇒ Array<String>

A list of the variant's presentment prices and compare-at prices in each of the shop's enabled presentment currencies. Each price object has the following properties:

  • currency_code: The three-letter code (ISO 4217 format) for one of the shop's enabled presentment currencies.
  • amount: The variant's price or compare-at price in the presentment currency.

Returns:

  • (Array<String>)


68
69
70
# File 'lib/falsify/models/product/product_variant.rb', line 68

def presentment_prices
  @presentment_prices
end

#price ⇒ String

The price of the product variant.

Returns:

  • (String)


76
77
78
# File 'lib/falsify/models/product/product_variant.rb', line 76

def price
  @price
end

#product_id ⇒ String

The unique numeric identifier for the product.

Returns:

  • (String)


79
80
81
# File 'lib/falsify/models/product/product_variant.rb', line 79

def product_id
  @product_id
end

#requires_shipping ⇒ Boolean

Whether a customer needs to provide a shipping address when placing an order for the product variant.

Returns:

  • (Boolean)


82
83
84
# File 'lib/falsify/models/product/product_variant.rb', line 82

def requires_shipping
  @requires_shipping
end

#sku ⇒ Boolean

A unique identifier for the product variant in the shop. Required in order to connect to a FulfillmentService.

Returns:

  • (Boolean)


86
87
88
# File 'lib/falsify/models/product/product_variant.rb', line 86

def sku
  @sku
end

#tax_code ⇒ String

This parameter applies only to the stores that have the Avalara AvaTax app installed. Specifies the Avalara tax code for the product variant.

Returns:

  • (String)


93
94
95
# File 'lib/falsify/models/product/product_variant.rb', line 93

def tax_code
  @tax_code
end

#taxable ⇒ Boolean

Whether a tax is charged when the product variant is sold.

Returns:

  • (Boolean)


89
90
91
# File 'lib/falsify/models/product/product_variant.rb', line 89

def taxable
  @taxable
end

#title ⇒ String

The title of the product variant.

Returns:

  • (String)


96
97
98
# File 'lib/falsify/models/product/product_variant.rb', line 96

def title
  @title
end

#updated_at ⇒ String

The date and time when the product variant was last modified. Gets returned in ISO 8601 format.

Returns:

  • (String)


100
101
102
# File 'lib/falsify/models/product/product_variant.rb', line 100

def updated_at
  @updated_at
end

#weight ⇒ String

The weight of the product variant in the unit system specified with weight_unit.

Returns:

  • (String)


103
104
105
# File 'lib/falsify/models/product/product_variant.rb', line 103

def weight
  @weight
end

#weight_unit ⇒ :g, ...

The unit of measurement that applies to the product variant's weight. If you don't specify a value for weight_unit, then the shop's default unit of measurement is applied. Valid values: g, kg, oz, and lb.

Returns:

  • (:g, :kg, :oz, :lb)


109
# File 'lib/falsify/models/product/product_variant.rb', line 109

enumerize :weight_unit, in: [:g, :kg, :oz, :lb]