Class: Falsify::Customcollection

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

Overview

See the API documentation.

Required Fields:

  • title

Instance Attribute Summary collapse

Instance Attribute Details

#body_htmlString

The description of the custom collection, complete with HTML markup. Many templates display this on their custom collection pages.

Returns:

  • (String)


13
14
15
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 13

def body_html
  @body_html
end

#handleString

A human-friendly unique string for the custom collection automatically generated from its title. This is used in shop themes by the Liquid templating language to refer to the custom collection. (limit: 255 characters)

Returns:

  • (String)


18
19
20
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 18

def handle
  @handle
end

#idString (readonly)

The ID for the custom collection.

Returns:

  • (String)


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

def id
  @id
end

#imageHash

Image associated with the custom collection. Valid values are:

  • attachment : An image attached to a custom collection returned as Base64-encoded binary data.
  • src : The source URL that specifies the location of the image.
  • alt : Alternative text that describes the collection image.
  • created_at : The time and date (ISO 8601 format) when the image was added to the collection.
  • width : The width of the image in pixels.
  • height : The height of the image in pixels.

Returns:

  • (Hash)


28
29
30
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 28

def image
  @image
end

#publishedString

Whether the custom collection is published to the Online Store channel.

Returns:

  • (String)


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

def published
  @published
end

#published_atString? (readonly)

The time and date (ISO 8601 format) when the collection was made visible. Returns null for a hidden custom collection.

Returns:

  • (String, nil)


38
39
40
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 38

def published_at
  @published_at
end

#published_scope:web, :global (readonly)

Whether the collection is published to the Point of Sale channel. Valid values:

  • web: The custom collection is published to the Online Store channel but not published to the Point of Sale channel.
  • global: The custom collection is published to both the Online Store channel and the Point of Sale channel.

Returns:

  • (:web, :global)


45
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 45

enumerize :published_scope, in: [:web, :global]

#sort_order"alpha-asc", ...

The order in which products in the custom collection appear. Valid values:

  • alpha-asc : Alphabetically, in ascending order (A - Z).
  • alpha-desc : Alphabetically, in descending order (Z - A).
  • best-selling : By best-selling products.
  • created : By date created, in ascending order (oldest - newest).
  • created-desc : By date created, in descending order (newest - oldest).
  • manual : Order created by the shop owner.
  • price-asc : By price, in ascending order (lowest - highest).
  • price-desc : By price, in descending order (highest - lowest). # @return [String]

Returns:

  • ("alpha-asc", "alpha-desc", "best-selling", "created", "created-desc", "manual", "price-asc", "price-desc")


58
59
60
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 58

def sort_order
  @sort_order
end

#template_suffixString?

The suffix of the liquid template being used. For example, if the value is custom, then the collection is using the collection.custom.liquid template. If the value is null, then the collection is using the default collection.liquid.

Returns:

  • (String, nil)


63
64
65
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 63

def template_suffix
  @template_suffix
end

#titleString

The name of the custom collection. (limit: 255 characters)

Returns:

  • (String)


67
68
69
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 67

def title
  @title
end

#updated_atString (readonly)

The date and time (ISO 8601 format) when the custom collection was last modified.

Returns:

  • (String)


70
71
72
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 70

def updated_at
  @updated_at
end