Module: ProductTemplates

Included in:
Ecommerce
Defined in:
lib/user/ecommerce/product_templates.rb

Instance Method Summary collapse

Instance Method Details

#create_product_template(data) ⇒ Object

Create product template.

Create a product template with data.

Parameters

data

(Hash) – Data to be submited.

Example

data = { 
  "title": "New Product Template",
  "slug": "new-product-template"
}
@data = @mints_user.create_product_template(data)


84
85
86
# File 'lib/user/ecommerce/product_templates.rb', line 84

def create_product_template(data)
    return @client.raw("post", "/ecommerce/product-templates/", nil, data_transform(data))
end

#get_product_template(id, options = nil) ⇒ Object

Get product template.

Get a product template info.

Parameters

id

(Integer) – Product template id.

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_product_template(1)

Second Example

options = { "fields": "title" }
@data = @mints_user.get_product_template(1, options)


68
69
70
# File 'lib/user/ecommerce/product_templates.rb', line 68

def get_product_template(id, options = nil)
    return @client.raw("get", "/ecommerce/product-templates/#{id}", options)
end

#get_product_templates(options = nil) ⇒ Object

Get product templates.

Get a collection of product templates.

Parameters

options

(Hash) – List of Resource Collection Options shown above can be used as parameter.

First Example

@data = @mints_user.get_product_templates

Second Example

options = { "fields": "title" }
@data = @mints_user.get_product_templates(options)


51
52
53
# File 'lib/user/ecommerce/product_templates.rb', line 51

def get_product_templates(options = nil)
    return @client.raw("get", "/ecommerce/product-templates", options)
end

#get_product_templates_support_dataObject

Get product templates support data.

Get support data used in product templates.

Example

@data = @mints_user.get_product_templates_support_data


35
36
37
# File 'lib/user/ecommerce/product_templates.rb', line 35

def get_product_templates_support_data
    return @client.raw("get", "/ecommerce/product-templates/support-data")
end

#get_product_templates_support_data_from_order_items_group(id) ⇒ Object

Get product templates support data from order items group.

Get product templates support data from a order items group.

Parameters

id

(Integer) – Order items group id.

Example

@data = @mints_user.get_product_templates_support_data_from_order_items_group(1)


26
27
28
# File 'lib/user/ecommerce/product_templates.rb', line 26

def get_product_templates_support_data_from_order_items_group(id)
    return @client.raw("get", "/ecommerce/product-templates/support-data/order-items-groups/#{id}")
end

#get_product_templates_support_data_from_product(id) ⇒ Object

Get product templates support data from product.

Get product templates support data from a product.

Parameters

id

(Integer) – Product id.

Example

@data = @mints_user.get_product_templates_support_data_from_product(1)


14
15
16
# File 'lib/user/ecommerce/product_templates.rb', line 14

def get_product_templates_support_data_from_product(id)
    return @client.raw("get", "/ecommerce/product-templates/support-data/products/#{id}")
end

#update_product_template(id, data) ⇒ Object

Update product template.

Update a product template info.

Parameters

id

(Integer) – Product template id.

data

(Hash) – Data to be submited.

Example

data = {
  "title": "New Product Template Modified",
  "slug": "new-product-template"
}
@data = @mints_user.update_product_template(3, data)


101
102
103
# File 'lib/user/ecommerce/product_templates.rb', line 101

def update_product_template(id, data)
    return @client.raw("put", "/ecommerce/product-templates/#{id}", nil, data_transform(data))
end