$i = 1;
foreach ($product->getOptions() as $o) {
$values = $o->getValues();
foreach ($values as $v) {
print_r($v->getData());
}
$i++;
}
上記のコードは、次の結果を出力します。
Array
(
[option_type_id] => 9
[option_id] => 3
[sku] =>
[sort_order] => 0
[default_title] => Black
[store_title] =>
[title] => Black
[default_price] => 0.0000
[default_price_type] => fixed
[store_price] =>
[store_price_type] =>
[price] => 0.0000
[price_type] => fixed
)
Array
(
[option_type_id] => 7
[option_id] => 3
[sku] =>
[sort_order] => 0
[default_title] => Red
[store_title] =>
[title] => Red
[default_price] => 0.0000
[default_price_type] => fixed
[store_price] =>
[store_price_type] =>
[price] => 0.0000
[price_type] => fixed
)
Array
(
[option_type_id] => 8
[option_id] => 3
[sku] =>
[sort_order] => 0
[default_title] => White
[store_title] =>
[title] => White
[default_price] => 0.0000
[default_price_type] => fixed
[store_price] =>
[store_price_type] =>
[price] => 0.0000
[price_type] => fixed
)
値を出力したい[title]
。それ、どうやったら出来るの?ありがとうございました。使ってみました$v->getData()['title']
が、うまくいきませんでした。