ModelShipping module

TemplateMethod

Template method allows programming its own way to create the rates.

A model in the Shipping module, with 21 members for templates, 22 API properties and 25 members for admin templates.

Shipping\Models\Frontend\TemplateMethod Shipping\Models\Api\TemplateMethod Shipping\Models\Backend\TemplateMethod Also in Shipping: BaseMethod Category Group Location MethodZoneRule Rate Shipment ShipmentLog Zone
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 21

Take no arguments.

# getDisplayType()
string
Returns the nice name of a method type
# getType()
string
Returns the type of condition
# getSnakeType()
string
Returns the type of condition in the snake case format: lowercase and connected by underline
# getSlugType()
string
Returns the type of condition in the slug format: lowercase and connected by hyphen
# getTemplateCode()
string
Gets the template code for this method.
# getId()
?int
# getName()
?string
# getConfiguration()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# isActive()
bool
# getRequestHook()
?Hook
# getResponseHook()
?Hook
# getGroup()
?Group
# getSite()
?Site
# getCategories()
?Collection<ategory>
# getWarehouses()
?Collection<Warehouse>
# getZones()
?Collection<one>
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 22

Read-only values on the record.

# displayType
string
Returns the nice name of a method type
# type
string
Returns the type of condition
# snakeType
string
Returns the type of condition in the snake case format: lowercase and connected by underline
# slugType
string
Returns the type of condition in the slug format: lowercase and connected by hyphen
# templateCode
string
Gets the template code for this method.
# editUrl Not in Templates
?string
Get the url for editing the record.
# deleteUrl Not in Templates
?string
Get the url for deleting the record.
# manageUrl Not in Templates
?string
Get the url for managing records.
# id
?int
# name
?string
# configuration
?array
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# active
bool
# requestHook
?Hook
# responseHook
?Hook
# group
?Group
# site
?Site
# categories
?Collection<ategory>
# warehouses
?Collection<Warehouse>
# zones
?Collection<one>

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 25

Take no arguments.

# getDisplayType()
string
Returns the nice name of a method type
# getType()
string
Returns the type of condition
# getSnakeType()
string
Returns the type of condition in the snake case format: lowercase and connected by underline
# getSlugType()
string
Returns the type of condition in the slug format: lowercase and connected by hyphen
# getTemplateCode()
string
Gets the template code for this method.
# getEditUrl() Not in Templates
?string
Get the url for editing the record.
# getDeleteUrl() Not in Templates
?string
Get the url for deleting the record.
# getManageUrl() Not in Templates
?string
Get the url for managing records.
# getId()
?int
# getName()
?string
# getConfiguration()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# isActive()
bool
# getRequestHook()
?Hook
# getResponseHook()
?Hook
# getGroup()
?Group
# getSite()
?Site
# getCategories()
?Collection<ategory>
# getWarehouses()
?Collection<Warehouse>
# getZones()
?Collection<one>
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned