Try our new AI assistant by clicking the chat icon in the lower right corner.
Runtime.js is a native JavaScript file for Miva Merchant. It get output on certain pages and contains functions that Miva uses natively as part of Attribute Machine. However, it also contains functions that a developer can optionally use to build new features.
Examples of these functions include
Starting in 10.03.00 and beyond, the output of runtime.js is controlled by a new component module that you can be assigned to any page. By default it is assigned to the following pages:
You'll notice that the PROD page is not listed above. This file is output on the product page but it happens automatically as part of the JS Attribute Machine needs to run.
Example of component assigned to the basket page
Default pages the runtimejs component is assigned to in 10.03.00
The file will get output in the head tag as part of the head_tag component
Starting in 10.03.00 there are new helper functions available in runtime.js that allow you to do things like update items in the basket or calculate and apply shipping to a basket. The underlying functions are available in the JSON API here under runtime: https://docs.miva.com/json-api/
These helper funcitons make it easier to run these runtime functions to manulipate the cart and perform other funcitons.
All these functions had a optional delegator parameter which the Miva admin uses to group and priortize requests. It can be omitted in most cases unless your features need that type of grouping and priortization.