Combination Facet Applications#
In Miva Version 10.10.00 Combination Facet Applications were introduced. The feature includes customer level tracking of previously used combination facet selections.
Miva Admin: Applications Tabs#
For each enabled Combination Facet, a tab on the Customer batch edit screen titled “FACET_NAME Applications” is created. This tab will contain a batch list that displays all of the combination facet selection records across all customers.
Another tab on the Edit Customer screen titled “FACET_NAME Applications” is also created. This tab contains a batch list which displays any Combination Facet selected that have been recorded for that customer.
Application Management AJAX Functions#
Runtime_CombinationFacetCustomerApplicationList_Load
#
This function will return an array of applications for the current customer, sorted by descending lastused
.
Example Requests#
JavaScript#
const Application_Load = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_Load, 'runtime', 'combofacets', 'Runtime_CombinationFacetCustomerApplicationList_Load');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetCustomerApplicationList_Load",
"Module_Code": "combofacets",
"Session_Type": "runtime"
}
Example Response#
{
success: 1,
data:
[
{
"id": 5,
"name": "COMBINATION_FACET_NAME",
"fields": [ 'a', 'b', 'c' ],
"lastused": 1235232,
},
{
"id": 9,
"name": "a c b",
"fields": [ 'a', 'c', 'b' ]
"lastused": 1235232,
}
]
}
Runtime_CombinationFacetCustomerApplication_Insert
#
This function is used to insert a new Combination Facet Customer Application. Requires that the current basket contain a logged-in customer record.
Request Parameters#
Parameter | Type | Description |
---|---|---|
Application_Name |
String | Combination Facet Code |
CombinationFacet_ID CombinationFacet_Code |
Number String |
Combination Facet ID Combination Facet Code |
CombinationFacetValues |
String | Comma separated list of combination facet values |
Example Requests#
JavaScript Example#
const Application_Insert = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_Insert, 'runtime', 'combofacets', 'Runtime_CombinationFacetCustomerApplication_Insert', 'Application_Name=APPLICATION_NAME' + '&' + 'CombinationFacet_Code=COMBINATION_FACET_CODE' + '&' + 'CombinationFacetValues=COMBINATION_FACET_VALUES');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetCustomerApplication_Insert",
"Module_Code": "combofacets",
"Session_Type": "runtime",
"Application_Name": "APPLICATION_NAME",
"CombinationFacet_Code": "COMBINATIONFACET_CODE",
"CombinationFacetValues": "COMBINATIONFACET_VALUES"
}
Example Response#
{
"success": 1
}
Runtime_CombinationFacetCustomerApplication_Update
#
This function will update an existing Combination Facet Customer Application, completely replacing its Combination Facet Customer Application Fields records.
The function will Require that the current basket contain a logged-in customer record, and that the provided Application_ID
be owned by the same customer. This function does not allow the associated Combination Facet code to be changed for the application, and should assume that the update applies to the already associated Combination Facet code.
Request Parameters#
Parameter | Type | Description |
---|---|---|
Application_ID |
Number | Combination Facet Application ID |
Application_Name |
String | Optional Application name value retained if not present |
CombinationFacetValues |
String | Comma separated list of combination facet values |
Example Requests#
JavaScript Example#
const Application_Update = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_Update, 'runtime', 'combofacets', 'Runtime_CombinationFacetCustomerApplication_Update', 'Application_ID=APPLICATION_ID' + '&' + 'Application_Name=APPLICATION_NAME' + '&' + 'CombinationFacet_Code=COMBINATION_FACET_CODE' + '&' + 'CombinationFacetValues=COMBINATION_FACET_VALUES');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetCustomerApplication_Update",
"Module_Code": "combofacets",
"Session_Type": "runtime",
"Application_ID": "APPLICATION_ID",
"Application_Name": "APPLICATION_NAME",
"CombinationFacetValues": "COMBINATIONFACET_VALUES"
}
Example Response#
{
"success": 1
}
Runtime_CombinationFacetCustomerApplication_Delete
#
This function will delete an existing Combination Facet Customer Application. The function requires that the current basket contain a logged-in customer record, and that the provided Application_ID
be owned by the same customer.
Request Parameters#
Parameter | Type | Description |
---|---|---|
Application_ID |
Number | Combination Facet Application ID |
Example Requests#
JavaScript Example#
const Application_Delete = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_Delete, 'runtime', 'combofacets', 'Runtime_CombinationFacetCustomerApplication_Delete', 'Application_ID=APPLICATION_ID');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetCustomerApplication_Delete",
"Module_Code": "combofacets",
"Session_Type": "runtime",
"Application_ID": "APPLICATION_ID"
}
Example Response#
{
"success": 1
}
Runtime_CombinationFacetCustomerApplication_Set_Cookie
#
Sets the persistent Combination Facet cookie based on a stored application, and updates the lastused timestamp on the stored application.
Requires that the current basket contain a logged-in customer record, and that the provided Application_ID be owned by the same customer.
Request Parameters#
Parameter | Type | Description |
---|---|---|
Application_ID |
Number | Combination Facet Application ID |
Example Requests#
JavaScript Example#
const Application_Set = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_Set, 'runtime', 'combofacets', 'Runtime_CombinationFacetCustomerApplication_Set_Cookie', 'Application_ID=APPLICATION_ID');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetCustomerApplication_Set_Cookie",
"Module_Code": "combofacets",
"Session_Type": "runtime",
"Application_ID": "APPLICATION_ID"
}
Example Response#
{
"success": 1
}
Runtime_CombinationFacetData_Load
#
This function will combine the behavior of the existing CombinationFacetAndFieldList_Load_All
and CombinationFacetAppliedValueList_Load_Cookie
with a return of customer application data (when the customer is logged in).
Request Parameters#
Parameter | Type | Description |
---|---|---|
CombinationFacet_ID CombinationFacet_Code |
Number String |
Combination Facet ID Combination Facet Code |
Example Requests#
JavaScript Example#
const Application_DataLoad = function (fitmentData) {
console.log(fitmentData);
}
AJAX_Call_Module(Application_DataLoad, 'runtime', 'combofacets', 'Runtime_CombinationFacetData_Load', 'CombinationFacet_Code=COMBINATION_FACET_CODE');
Runtime JSON API Call#
{
"Store_code": "{{Store_code}}",
"Function": "Module",
"Module_Function": "Runtime_CombinationFacetData_Load",
"Module_Code": "combofacets",
"Session_Type": "runtime",
"CombinationFacet_Code": "COMBINATION_FACET_CODE"
}
Response Parameters#
Parameter | Type | Description |
---|---|---|
facet |
Object | Contains the facet and its fields |
applied_values |
Object | Contains any fields present in the persistent cookie for the specified facet If the cookie is not present, the array will be present but empty. |
customer_applications |
Object | Contains all customer applications. Will be present, even if empty, if basket has a logged-in customer If the Basket has no logged-in customer it will not output |
facet
Object#
Parameter | Type | Description |
---|---|---|
code |
String | Combination Facet Code |
name |
String | Combination Facet Name |
fields |
Object | Contains combination facet field data |
fields
Object#
Parameter | Type | Description |
---|---|---|
code |
String | Field Code |
name |
String | Field Name |
customer_applications
Object#
Parameter | Type | Description |
---|---|---|
id |
Number | Application ID |
name |
String | Application Name |
lastused |
Number | UNIX Timestamp of applications last use |
fields |
Object | Contains comma separated list of combination facet fields |
Example Response#
{
"success": 1,
"data": {
"facet": {
"code": "combofacet_01",
"name": "Combination Facet 01",
"fields": [
{
"code": "field_01",
"name": "Field 01"
},
{
"code": "field_02",
"name": "Field 02"
}
]
},
"applied_values": [
"A",
"B"
],
"customer_applications": [
{
"id": 1,
"name": "",
"lastused": 1723578780,
"fields": [
"A",
"B"
]
},
{
"id": 2,
"name": "Combination Facet Name 03",
"lastused": 1723496308,
"fields": [
"B",
"D"
]
},
{
"id": 3,
"name": "Combination Facet Name 03",
"lastused": 1723576552,
"fields": [
"A",
"D"
]
}
]
}
}