Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

...

Prepare_select

...

  • Delivery type

...

Expand
titleUnfold
Code Block
languagejson
[
  {
    "name": "delivery",
    "field": "order.delivery.type"
  }
]

...

Pack_scan

...

  • Delivery type

...

Expand
titleUnfold
Code Block
languagejson
[
  {
    "name": "delivery",
    "field": "parcel.order.delivery.type",
    "filter_type": "filter_sub_entity"
  }
]

...

Bag_scan

...

  • Single line orders

...

titleUnfold

...

languagejson

...

style

...

Default filter

...

Default JSON format

none

Introduction

You can add filtering options on some of the store app pages. This facilitates the preparation process by selecting only items from certain brands, certain shelves or certain delivery modes.

...

A default configuration is applied in the pages, but this configuration can be overridden. To do this, go to the Configuration > Store App > Pages > {Page name} > Filters section.

...

Configuration structure

The structure is an array of objects, each object corresponding to 1 filter, with the following fields:

  • name (string - mandatory) - Key used to translate the filter, which appears in the format 'filter.{name}.title'.

  • field (string - mandatory) - Path used to access the filter value in the entity structure (ex: order.delivery.type)

  • filter_type (string- optional) - Choice of one of the following three specific filter types.

    • filter_sub_entity - Filters on path sub-entities. If the field is an array, it must be used.

    • different_value_count_is - Filters according to a specific number of values in the field. Is often used for single-line orders.

    • order_type_is - Specific filter for filtering by order type. For this, it is necessary to specify the possible values in the ‘possible_values’ field, the others will be ignored.

  • possible_values(array of objects - optional) Restricts the filter to specific values. All others will be ignored.

    • value (string - mandatory) - One of the filter values.

    • translation key (string - optional) - Translation key for displaying the value.

  • do_not_translate - Display the raw filter value instead of the translation key

Default configuration and overlays examples by page

The pages below provide a default configuration, but they may be overloaded. Examples are given to help.

...

Page

Default filter

Default JSON format

Overlays examples

Prepare_select

  • Delivery type

Expand
titleDefault config
Code Block
languagejson
[
  {
    "name": "
monoline
delivery",
    "
filter_type
field": "
different_value_count_is",
order.delivery.type"
  
"field": "content_ids", "possible_values": [
}
]
Expand
titleFilter on the delivery mode stored in the order information section
Code Block
languagejson
[
    {
        "
value
field": 
1
"order.information.delivery_mode",
        "
translation_key
name": "
filter.monoline.is_monoline
delivery"
    
} ] } ]Picking
}
]

Pack_scan

  • Delivery type

Delivery carrier
  • Department feature of items

  • Single line orders

  • Expand
    title
    Unfold
    Default config
    Code Block
    languagejson
    [
      {
        "name": "delivery",
        "field": "parcel.order.delivery.type"
    }
    ,
    {
    
        "
    name
    filter_type": "
    carrier
    filter_sub_entity"
    ,
    
      
    "field": "order.delivery.carrier.name" },
    }
    ]
    Expand
    titleFilter on the delivery type + the carrier name of the parcel
    Code Block
    languagejson
    [
      {
        "
    name
    field": "
    departement
    parcel.order.delivery.type",
        "filter_type": "filter_sub_entity",
        "
    do_not_translate
    name":
    true,
     "delivery"
      },
      {
        "field": "
    item
    parcel.
    features
    delivery.
    departement.0" }, { "name": "monoline"
    carrier.name",
        "filter_type": "
    different
    filter_
    value
    sub_
    count_is
    entity",
        "
    field
    name": "
    item_id
    carrier"
    ,
    
      
    "possible_values": [
    }
    ]

    Bag_scan

    • Single line orders

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
     
    {
       "name": "monoline",
        "
    value
    filter_type": 
    1,
    "different_value_count_is",
        "
    translation_key
    field": "
    filter.monoline.is_monoline"
    content_ids",
        "possible_values": [
    
    }
         
    ]
     
    } ]

    Consolidation

    • Delivery type

    • Delivery carrier

    • Single line orders

    Expand
    titleUnfold
    Code Block
    languagejson
    [
    {
       
    {
         "
    name
    value": 
    "delivery",
    1,
            "
    field
    translation_key": "
    order
    filter.
    delivery
    monoline.
    type
    is_monoline"
          }
    ,
    
      
    {
      ]
      }
    ]

    N/A

    Picking

    • Delivery type

    • Delivery carrier

    • Department feature of items

    • Single line orders

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "
    carrier
    delivery",
        "field": "order.delivery.
    carrier.name
    type"
      },
      {
        "name": "
    monoline
    carrier",
        "
    filter_type
    field": "
    different_value_count_is"
    order.delivery.carrier.name"
      },
      {
        "
    field
    name": "
    item_id
    departement",
        "
    possible
    filter_
    values
    type": 
    [
    "filter_sub_entity",
        
    {
    "do_not_translate": true,
        
    "
    value
    field": 
    1,
    "item.features.departement.0"
      },
      {
        "
    translation_key
    name": "
    filter.
    monoline
    .is_monoline
    ",
        "filter_type": "different_value_count_is",
     
    }
       "field": "item_id",
    
    ]
       
    } ]

    Boxing

    • Delivery type

    • Delivery carrier

    • Single line orders

    Expand
    titleUnfold
    Code Block
    languagejson
    [
     "possible_values": [
          {
            "
    name
    value": 
    "delivery",
    1,
            "
    field
    translation_key": "
    order
    filter.
    delivery
    monoline.
    type
    is_monoline"
       
    },
       
    {
    }
        
    "name": "carrier",
    ]
      }
    ]
    Expand
    titleAdd a filter on the order types (sfs, c&c, ropis)
    Code Block
    languagejson
    [
        {
            "field": "order.delivery.
    carrier.name
    type",
      
    },
       
    {
       
    "name": "
    monoline",
    delivery"
        },
        {
      
    "filter_type":
     
    "different_value_count_is",
         "field": "
    item_id
    order.delivery.carrier.name",
            "
    possible_values
    name": 
    [
    "carrier"
        },
        {
            "
    value
    do_not_translate": 
    1
    true,
            "
    translation_key
    field": "item.features.departement.0",
            "filter_type": "filter
    .monoline.is_monoline"
    _sub_entity",
          
    }
      "name": "departement"
     
    ]
       }
    ]

    Order list

    • Delivery type

    • Delivery carrier

    • Order state

    • Order type

    • Single line orders

    Expand
    titleUnfold
    Code Block
    languagejson
    [
    ,
        {
         
    {
       
    "
    name
    field": "
    delivery
    item_id",
            "
    field
    filter_type": "
    order.delivery.type"
    different_value_count_is",
      
    },
       
    {
       
    "name": "
    carrier
    monoline",
            "
    field
    possible_values":
    "order.delivery.carrier.name"
     [
       
    },
       
    {
         
    "name": "state",
     {
        
    "field":
     
    "state"
       
    },
       
    {
         "
    name
    translation_key": "
    order_type
    filter.monoline.is_monoline",
        
    "filter_type": "order_type_is",
                "value": 1
                }
            ]
        },
        {
            "field": "order_type",
            "filter_type": "order_type_is",
            "name": "order_type",
            "possible_values"
    : [ { "value": "ffs" }, { "value": "ckc" }, { "value": "ropis" } ] }, { "name": "monoline", "filter_type": "different_value_count_is
    : [
                {
                    "value": "ffs"
                },
                {
                    "value": "ckc"
                },
                {
                    "value": "ropis"
                }
            ]
        }
    ]
    Expand
    titleAdd new filters on item features (in the example, the size)
    Code Block
    languagejson
    [
        {
            "field": "order.delivery.type",
            "name": "delivery"
        },
        {
            "field": "order.delivery.carrier.name",
            "name": "carrier"
        },
        {
            "do_not_translate": true,
            "field": "item.features.departement.0",
            "filter_type": "filter_sub_entity",
            "name": "departement"
        },
        {
            "field": "item_id",
            "filter_type": "different_value_count_is",
            "name": "monoline",
            "possible_values": [
                {
                    "translation_key": "filter.monoline.is_monoline",
                    "value": 1
                }
            ]
        },
        {
            "do_not_translate": true,
            "field": "item.features.size.0",
            "filter_type": "filter_sub_entity",
            "name": "size"
        }
    ]

    Consolidation

    • Delivery type

    • Delivery carrier

    • Single line orders

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "delivery",
        "field": "order.delivery.type"
      },
      {
        "name": "carrier",
        "field": "order.delivery.carrier.name"
      },
      {
        "name": "monoline",
        "filter_type": "different_value_count_is",
        "field": "item_id",
        "possible_values": [
          {
            "value": 1,
            "translation_key": "filter.monoline.is_monoline"
          }
        ]
      }
    ]

    N/A

    Boxing

    • Delivery type

    • Delivery carrier

    • Single line orders

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "delivery",
        "field": "order.delivery.type"
      },
      {
        "name": "carrier",
        "field": "order.delivery.carrier.name"
      },
      {
        "name": "monoline",
        "filter_type": "different_value_count_is",
        "field": "item_id",
        "possible_values": [
          {
            "value": 1,
            "translation_key": "filter.monoline.is_monoline"
          }
        ]
      }
    ]

    N/A

    Order list

    • Delivery type

    • Delivery carrier

    • Order state

    • Order type

    • Single line orders

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "delivery",
        "field": "order.delivery.type"
      },
      {
        "name": "carrier",
        "field": "order.delivery.carrier.name"
      },
      {
        "name": "state",
        "field": "state"
      },
      {
        "name": "order_type",
        "filter_type": "order_type_is",
        "field": "order",
        "possible_values": [
          { "value": "ffs" },
          { "value": "ckc" },
          { "value": "ropis" }
        ]
      },
      {
        "name": "monoline",
        "filter_type": "different_value_count_is",
        "field": "item_id",
        "possible_values": [
          {
            "value": 1,
            "translation_key": "filter.monoline.is_monoline"
          }
        ]
      }
    ]
    Expand
    titleRestrict the state filter on specific values
    Code Block
    languagejson
    [
        {
            "field": "order.delivery.type",
            "name": "delivery"
        },
        {
            "field": "order.delivery.carrier.name",
            "name": "carrier"
        },
        {
            "field": "state",
            "name": "state",
            "possible_values": [
                {
                    "value": "new"
                },
                {
                    "value": "picking"
                },
                {
                    "value": "consolidable"
                },
                {
                    "value": "consolidating"
                },
                {
                    "value": "packable"
                },
                {
                    "value": "packing"
                },
                {
                    "value": "finish"
                },
                {
                    "value": "dispatched"
                }
            ]
        },
        {
            "field": "order",
            "filter_type": "order_type_is",
            "name": "order_type",
            "possible_values": [
                {
                    "value": "ffs"
                },
                {
                    "value": "ckc"
                },
                {
                    "value": "ropis"
                }
            ]
        },
        {
            "field": "item_id",
            "filter_type": "different_value_count_is",
            "name": "monoline",
            "possible_values": [
                {
                    "translation_key": "filter.monoline.is_monoline",
                    "value": 1
                }
            ]
        }
    ]

    Users

    • Operator state

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "state",
        "field": "state",
        "possible_values": [
          {
            "value": "idle",
            "translation_key": "entity_states.operator.idle"
          },
          {
            "value": "picking",
            "translation_key": "entity_states.operator.picking"
          },
          {
            "value": "consolidating",
            "translation_key": "entity_states.operator.consolidating"
          },
          {
            "value": "packing",
            "translation_key": "entity_states.operator.boxing"
          }
        ]
      }
    ]

    N/A

    Catalog

    • Color feature

    • Size feature

    Note

    The available filters in the catalog must appear in the GET/categories API call

    Please follow the steps in the example on the right to add a filter.

    Expand
    titleDefault config
    Code Block
    languagejson
    [
      {
        "name": "color",
        "field": "color",
        "do_not_translate": true
      },
      {
        "name": "size",
        "field": "size",
        "do_not_translate": true
      }
    ]
    Expand
    titleAdd an item feature filter (e.g. departement)

    Unlike the other pages, adding a new features filter to the catalogue requires more complex configuration, as the search is carried out in all the items in the database. Here are the steps to follow:

    1. Make sure that the feature is indexed on your project. To find out, please contact your Onestock technical contact.

    2. Add the feature to the ‘Available filters’ configuration available via this path Configuration > Store App > Pages > Catalog > Specific settings > Available filters

      image-20241202-103034.pngImage Added
    3. Wait for the pre-calculation of the filters, which runs every hour.
      Note : The change can be applied immediately by calling the POST/category_filters/compute route, but it is not open to external users. Please contact your Onestock technical contact.

    4. Add the configuration to the ‘Filters’ section of the catalogue page:

    Code Block
    languagejson
    [
      {
        "name": "color",
        "field": "color",
        "do_not_translate": true
      },
      {
        "name": "size",
        "field": "
    item_id
    size",
        "
    possible
    do_not_
    values
    translate": 
    [
    true
      },
      
    {
    
        "
    value": 1, "translation_key": "filter.monoline.is_monoline"
    do_not_translate": true,
        
    }
    "field": "departement",
        
    ]
    "name": "departement"
      }
    ]

    Users

    • Operator state

    Expand
    title
    Unfold
    Restrict the possible size values to a specific list
    Code Block
    languagejson
    [
      {
        "
    name
    do_not_translate": 
    "state"
    true,
        "field": "
    state
    color",
    
    
    "possible_values": [
        "name": "color"
     
    {
     },
      {
        "
    value
    do_not_translate": 
    "idle"
    true,
    
        
    "
    translation_key
    field": "
    entity_states.operator.idle"
    size",
        
    }
    "name": "size",
        "possible_values": [
    
    {
        
    "value": "picking",
      {
            "
    translation_key
    value": "
    entity_states.operator.picking
    XS"
          },
          {
            "value": "
    consolidating
    S"
    ,
    
          },
        
    "translation_key":
     
    "entity_states.operator.consolidating"
     {
         
    },
       "value": "M"
      
    {
        },
        
    "value": "packing",
      {
            "
    translation_key
    value": "
    entity_states.operator.boxing
    L"
          }
    ,
       
    ]
       
    } ]

    Catalog

    • Color feature

    • Size feature

    Expand
    titleUnfold
    Code Block
    languagejson
    [
    {
       
    {
         "
    name
    value": "
    color
    XL"
    ,
    
     
    "field": "color",
         
    "do_not_translate": true
    },
       
    },
       {
            "
    name
    value": "
    size
    XXL"
    ,
    
        
    "field":
     
    "size",
     }
       
    "do_not_translate": true
     ]
      }
    ]

    Configuration overlay

    ...

    name

    ...

    field

    ...

    filter_type

    ...

    possible_values