{"product_id":"custom-patina-full-brogue","title":"Custom Patina Full Brogue","description":"\u003cstyle\u003e\u003c!--\n.embed-responsive {\n  position: relative;\n  display: block;\n  height: 0;\n  padding: 0;\n  overflow: hidden;\n}\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  border: 0;\n}\n.embed-responsive-16by9 {\n  padding-bottom: 56.25%;\n}\n.embed-responsive-4by3 {\n  padding-bottom: 75%;\n}\n--\u003e\u003c\/style\u003e\u003cscript\u003e\/\/ \u003c![CDATA[\n$('#main').removeClass('twelve offset-by-one').addClass('thirteen');\n\nfunction matlab_jsonp(data) { \n\treturn data;\n}\n\nfunction PiecesMaterialsCsvToJson(csv) {\n  var obj_result = [];\n  var lines = csv.split(';');\n  $.each(lines, function(i, l) {\n  \tif (l.length \u003e 0) {\n\t  \tvar parts = l.split(',');\n\t  \tvar obj_tmp = {\n\t  \t\tModelName: parts[0],\n\t  \t\tPieceName: parts[1],\n\t  \t\tMaterialName: parts[2],\n\t  \t\tPieceId: parts[3],\n\t  \t\tMaterialId: parts[4],\n\t  \t}\n\t  \tobj_result.push(obj_tmp);\n\t }\n  });\n  return JSON.stringify(obj_result);\n}\n\nfunction AlugroupAddToCart(data) {\n\t\/*\n\tvar f = document.createElement('form'); \n\tf.style.display = 'none'; \n\tdocument.body.appendChild(f); \n\tf.method = 'POST'; \n\tf.action = '\/cart\/add'; \n\t\n\tvar v = document.createElement('input'); \n\tv.setAttribute('type', 'hidden'); \n\tv.setAttribute('name', 'id'); \n\tv.setAttribute('value', data.variant_id); \n\tf.appendChild(v); \n\n\tvar v = document.createElement('input'); \n\tv.setAttribute('type', 'hidden'); \n\tv.setAttribute('name', 'properties[COMPANY_ID]'); \n\tv.setAttribute('value', '418'); \n\tf.appendChild(v); \n\n\tvar v = document.createElement('input'); \n\tv.setAttribute('type', 'hidden'); \n\tv.setAttribute('name', 'properties[ORDER_GUID]'); \n\tv.setAttribute('value', data.guid); \n\tf.appendChild(v); \n\n\tf.submit();\n\t*\/\n\n\t$.post('\/cart\/add.js', {\n\t\tquantity: 1,\n\t\tid: data.variant_id,\n\t\tproperties: {\n\t\t\t'_COMPANY_ID': '418',\n\t\t\t'ORDER_GUID': data.guid,\n\t\t\t'_PIECES_MATERIALS': data.pieces_materials,\n                        'SCALE': data.scale.text,\n                        'SIZE': data.size.text,\n                        'WIDTH': data.width.text\n\t\t}\n\t}, null, 'json')\n\t.done(function() {\n\t\twindow.open('\/cart', '_self');\n                BackToUnity();\n\t});\n}\n\nwindow.IframeCommands = {}\nwindow.IframeCommands['cart.add'] = function(parameters) {\n  console.log('[IframeCommands][cart.add]', parameters);\n  var data = parameters;\n  data.variant_id = 0;\n  if (!data.id_product \u0026\u0026 data.product_id) data.id_product = data.product_id;\n  var get_product_data = $.get('\/products\/' + data.id_product + '.json', null, null, 'json');\n  var get_pieces_materials = $.ajax('http:\/\/matlab.alugroup.es\/empresas\/418\/orders\/temp\/' + data.guid + '\/' + data.guid + '-info.txt', { cache: true, dataType: 'jsonp', jsonpCallback: 'matlab_jsonp' });\n  $.when(get_product_data, get_pieces_materials)\n    .done(function(product_data, pieces_materials) {\n\tdata.pieces_materials = PiecesMaterialsCsvToJson(pieces_materials[0]);\n\tvar product = product_data[0].product;\n        data.variant_id = product.variants[0].id;\n\t\t\t\t\n\tAlugroupAddToCart(data);\n    });\n}\n\nvar listener = function(event) {\n  console.log(event.data);\n\t\tvar ext_cmd = event.data.command;\n\t\tif (ext_cmd) {\n\t\t\tconsole.log(\"[iframe] Command = \", ext_cmd.name);\n\t\t\tvar local_cmd = window.IframeCommands[ext_cmd.name];\n\t\t\tif (local_cmd) {\n\t\t\t\tlocal_cmd(ext_cmd.parameters);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (window.addEventListener) {\n\t  addEventListener(\"message\", listener, false);\n\t} else {\n\t  attachEvent(\"onmessage\", listener);\n\t}\n\/\/ ]]\u003e\u003c\/script\u003e\n\u003cdiv style=\"width: 100%;\" class=\"embed-responsive embed-responsive-16by9\"\u003e\u003ciframe src=\"http:\/\/shop.smytheanddigby.com\/\"\u003e\n\u003c\/iframe\u003e\u003c\/div\u003e","brand":"Smythe \u0026 Digby","offers":[{"title":"Default Title","offer_id":34295317446,"sku":"","price":425.0,"currency_code":"USD","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0575\/8913\/products\/full_brogue_patina_9933c211-1658-42f0-87f1-259ea1273764.png?v=1535212890","url":"https:\/\/smytheanddigby.com\/products\/custom-patina-full-brogue","provider":"Smythe \u0026 Digby","version":"1.0","type":"link"}