Показать сообщение отдельно
  #9 (permalink)  
Старый 04.08.2015, 10:44
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,109

ligisayan,
значит нет у вас ничего в variations_form на момент проверки
иначе всё нормально выводится
вывод третьего элемента массива
var variations_form =   [{
    "variation_id": 3354,
    "variation_is_visible": true,
    "variation_is_active": true,
    "is_purchasable": true,
    "display_price": 260000,
    "display_regular_price": 260000,
    "attributes": {
        "attribute_pa_size": "large"
    },
    "image_src": "",
    "image_link": "",
    "image_title": "",
    "image_alt": "",
    "price_html": "<span class=\"price\"><span class=\"amount\">260.000 руб.<\/span><\/span>",
    "availability_html": "",
    "sku": "",
    "weight": " kg",
    "dimensions": "",
    "min_qty": 1,
    "max_qty": "",
    "backorders_allowed": false,
    "is_in_stock": true,
    "is_downloadable": false,
    "is_virtual": false,
    "is_sold_individually": "no"
}, {
    "variation_id": 3355,
    "variation_is_visible": true,
    "variation_is_active": true,
    "is_purchasable": true,
    "display_price": 160000,
    "display_regular_price": 160000,
    "attributes": {
        "attribute_pa_size": "medium"
    },
    "image_src": "",
    "image_link": "",
    "image_title": "",
    "image_alt": "",
    "price_html": "<span class=\"price\"><span class=\"amount\">160.000 руб.<\/span><\/span>",
    "availability_html": "",
    "sku": "",
    "weight": " kg",
    "dimensions": "",
    "min_qty": 1,
    "max_qty": "",
    "backorders_allowed": false,
    "is_in_stock": true,
    "is_downloadable": false,
    "is_virtual": false,
    "is_sold_individually": "no"
}, {
    "variation_id": 3356,
    "variation_is_visible": true,
    "variation_is_active": true,
    "is_purchasable": true,
    "display_price": 80000,
    "display_regular_price": 80000,
    "attributes": {
        "attribute_pa_size": "small"
    },
    "image_src": "",
    "image_link": "",
    "image_title": "",
    "image_alt": "",
    "price_html": "<span class=\"price\"><span class=\"amount\">80.000 руб.<\/span><\/span>",
    "availability_html": "",
    "sku": "",
    "weight": " kg",
    "dimensions": "",
    "min_qty": 1,
    "max_qty": "",
    "backorders_allowed": false,
    "is_in_stock": true,
    "is_downloadable": false,
    "is_virtual": false,
    "is_sold_individually": "no"
}]
alert(variations_form[2]['price_html']);
Ответить с цитированием