Reply
Highlighted
Visitor
Posts: 1
Registered: ‎08-03-2018

About mapping hierarchical JavaScript objects

A large scale site that I'm working with more or less follows the CEDDL 1.0 "spec". In the spec products on, lets say, a product listing page are described in the product attribute of the digitalData object in a form of an array of separate product objects.

I'd need to map the properties of these product objects that are in the array. The amount of the product objects in the array can vary between scopes. What are my options?

The Flatten JSON Objects extension only helps in mapping the last product in the array as it operates in a mode where it doesn't resolve conflicts between object keys in the product objects and thus the data that you're left with is just the data of the last product in the array of products.

The C-commerce extension seems to understand arrays but it requires the data to be in a very different format than what the data is currently in.

Reply
0 Kudos