Skip to content

Instantly share code, notes, and snippets.

@antillas21
Last active December 15, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antillas21/5172001 to your computer and use it in GitHub Desktop.
Save antillas21/5172001 to your computer and use it in GitHub Desktop.
Entity JSON
{
"catalog_product_id":4,
"created_at":"2013-03-06T19:52:18Z",
"entity_type":"Printable",
"id":14,
"live":true,
"properties": {
"Quantity":[
{
"option_name":"250",
"price_modifier_value":"0",
"price_modifier_type":"$"
}
],
"Coating":[
{
"option_name":"UV Coating",
"price_modifier_value":"10",
"price_modifier_type":"$"
}
],
"Paper Stock":[
{
"option_name":"16pt Paper Stock",
"price_modifier_value":"5",
"price_modifier_type":"$"
}
]
},
"updated_at":"2013-03-15T18:22:21Z"
}
{
"catalog_product_id":4,
"created_at":"2013-03-06T19:52:18Z",
"entity_type":"Printable",
"id":14,
"live":true,
"properties": {
{
"group": "Quantity",
"options": [
{
"option_name":"250",
"price_modifier_value":"0",
"price_modifier_type":"$"
}
]
},
{
"group": "Coating",
"options": [
{
"option_name":"UV Coating",
"price_modifier_value":"10",
"price_modifier_type":"$"
},
{
"option_name":"No Coating",
"price_modifier_value":"0",
"price_modifier_type":"$"
}
]
},
{
"group": "Paper Stock",
"options": [
{
"option_name":"16pt Paper Stock",
"price_modifier_value":"5",
"price_modifier_type":"$"
}
]
}
},
"updated_at":"2013-03-15T18:22:21Z"
}
@narcisoguillen
Copy link

Sense we are using Backbone I think it could be a good idea to have an array of JSONs so we can use them as collections

[ {}, {}, {} ];

But I'm not sure how can we accomplish this

@narcisoguillen
Copy link

Maybe each JSON could be something like

{
Group: 'Quantity',
options: [ {}, {}, {} ]
}

@narcisoguillen
Copy link

I was thinking on something a little more like this, co I can have a collection of groups [ { group: '' , options: [] } ]

{
  "catalog_product_id":4,
  "entity_type":"Printable",
  "id":14,
  "live":true,
 [
    {
        "group": "Quantity",
        "options": [
            {
                "option_name":"250",
                "price_modifier_value":"0",
                "price_modifier_type":"$"
            }
        ]
    },
    {
        "group": "Coating",
        "options": [
            {
                "option_name":"UV Coating",
                "price_modifier_value":"10",
                "price_modifier_type":"$"
            },
            {
                "option_name":"No Coating",
                "price_modifier_value":"0",
                "price_modifier_type":"$"
            }
        ]
    },
    {
        "group": "Paper Stock",
        "options": [
            {
                "option_name":"16pt Paper Stock",
                "price_modifier_value":"5",
                "price_modifier_type":"$"
            }
        ]
    }
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment