Akeneo helper functions


You can use the helper functions listed below when developing templates for use with the Akeneo connector.

Please note that some functions are only compatible with certain template types.

$getProductValue

Returns the product's value for a given attribute name and locale. If the field doesn't have a locale, it will return the value without locale.

Input

  1. A locale string
  2. The field name

Examples

$getProductValue("fr_FR", "color")
=> "bleu"

$getProductValue("en_US", "color")
=> "blue"

/* 
* Uses the locale value dynamically.
* Great when templates are reused across indexes.
*/
$getProductValue(external.__connection.locale, "color")
=> "bleu" /* when the connector is running with fr_FR */
=> "blue" /* when the connector is running with en_US */