How can I insert a picture into an array? It is desirable that the path was through src or from options only from the buffer? If only from the buffer, how?
Code
`http://codepen.io/rublev/pen/ZOYvNL` $(document).ready(function() { // Product data to be used in shop and in cart var products = { 'ΠΡΡ-ΠΠΎΡΠΊ' : ['ΠΡΡ-ΠΠΎΡΠΊ', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ 1300Π³Ρ.", 699, '', 1], 'ΠΠ΅Π³ΠΈΡΠ°ΡΠΈΠ°Π½ΡΠΊΠ°Ρ' : ['ΠΠ΅Π³ΠΈΡΠ°ΡΠΈΠ°Π½ΡΠΊΠ°Ρ', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ 1300Π³Ρ.", 699, '', 2], 'Π‘Π΅ΠΌΡΡΠΊΠ°' : ['Π‘Π΅ΠΌΡΡΠΊΠ°', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ 1300Π³Ρ.", 699, '', 3], 'ΠΡΠ»ΡΠ΅ΡΠ°' : ['ΠΡΠ»ΡΠ΅ΡΠ°', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ, ΡΠΉΡΠΎ 1300Π³Ρ.", 699, '', 4], 'Π‘ΡΠΎΠ»ΠΈΡΠ½Π°Ρ' : ['Π‘ΡΠΎΠ»ΠΈΡΠ½Π°Ρ', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ 1300Π³Ρ.", 699, '', 5], 'ΠΠ°Π»ΡΡΠΈΠΎΠ½Π΅ ΠΏΠΎ-ΠΌΠ΅ΠΊΡΠΈΠΊΠ°Π½ΡΠΊΠΈ' : ['ΠΠ°Π»ΡΡΠΈΠΎΠ½Π΅', "Π‘ΡΡ, ΡΠ°ΠΌΠΏΠΈΠ½ΡΠΎΠ½Ρ,ΡΠ°Π»ΡΠΌΠΈ, ΠΏΠΎΠΌΠΈΠ΄ΠΎΡΡ 1300Π³Ρ.", 699, '', 6] }; var drinks = { 'Coca-cola' : ['Coca-cola', "0.33", 69, '', 1], 'Pepsi' : ['Pepsi', "0.33", 69, '..img/pepsi.png' , 2], 'Heineken' : ['Heineken', "0.33", 69, '', 3] }; // Populates shop with items based on template and data in var products var $shop = $('.shop'); var $shopDrinks = $('.shopDrinks'); var $cart = $('.cart-items'); for(var item in products) { var itemName = products[item][0], itemDescription = products[item][1], itemPrice = products[item][2], itemImg = products[item][3], itemId = products[item][4], $template = $($('#productTemplate').html()); $template.find('.main-menu__product-name').text(itemName); $template.find('.pizza-structure').text(itemDescription); $template.find('.main-menu__cash').text(itemPrice + 'Π '); $template.data('id', itemId); $template.data('name', itemName); $template.data('description', itemDescription); $template.data('price', itemPrice); $template.data('image', itemImg); $shop.append($template); } for(var drink in drinks){ var drinkName = drinks[drink][0], drinkSize = drinks[drink][1], drinkPrice = drinks[drink][2], drinkImg = drinks[drink][3], drinkId = drinks[drink][4], $template = $($('#drinkTemplate').html()); $template.find('.drink-name').text(drinkName); $template.find('.drink-price').text(drinkPrice + 'Π '); $template.find('drink-img', 'src(' + drinkImg + ')'); $template.find('.drink-size').text(drinkSize); $template.data('id', drinkId); $template.data('name', drinkName); $template.data('price', drinkPrice); $template.data('img', drinkImg); $template.data('size', drinkSize); $shopDrinks.append($template); } });