I am using woocommerce 2.6 now on woocommerce 3.0 output of $item->get_items
has changed from Array to Objects.
I want to convert object std class to array by key name to fetch data. Below is output of custom woocommerce 3.x vardump.
Please help me on this.
[1]=>
object(stdClass)#18913 (3) {
["id"]=>
int(3944)
["key"]=>
string(5) "Vuxen"
["value"]=>
string(15) "2 (4 800,00 Kr)"
}
[2]=>
object(stdClass)#18912 (3) {
["id"]=>
int(3945)
["key"]=>
string(18) "Totalt biljettpris"
["value"]=>
string(11) "4 800,00 Kr"
}
[3]=>
object(stdClass)#18911 (3) {
["id"]=>
int(3946)
["key"]=>
string(30) "jrp_name_adult_ordinary_7day_1"
["value"]=>
string(26) "undefined/kjhjksh/jdhfjshk"
}
[4]=>
object(stdClass)#18910 (3) {
["id"]=>
int(3947)
["key"]=>
string(13) "Nationality_1"
["value"]=>
string(25) "Nej, ej på japanskt pass"
}
[5]=>
object(stdClass)#18909 (3) {
["id"]=>
int(3948)
["key"]=>
string(30) "jrp_name_adult_ordinary_7day_2"
["value"]=>
string(33) "undefined/jhdsfjjhdkjs/jkdshfjshj"
}
[6]=>
object(stdClass)#18908 (3) {
["id"]=>
int(3949)
["key"]=>
string(13) "Nationality_2"
["value"]=>
string(21) "Ja, på japanskt pass"
}
[7]=>
object(stdClass)#18907 (3) {
["id"]=>
int(3950)
["key"]=>
string(11) "Avresedatum"
["value"]=>
string(10) "30/09/2017"
}
[8]=>
object(stdClass)#18906 (3) {
["id"]=>
int(3951)
["key"]=>
string(12) "Sätt kryss:"
["value"]=>
string(65) "Jag har förstått villkoren för användning av Japan Rail Pass."
}
[9]=>
object(stdClass)#18905 (3) {
["id"]=>
int(3952)
["key"]=>
string(12) "Sätt kryss:"
["value"]=>
string(88) "Jag förstår att det är mitt ansvar att se till att jag har korrekt visum i mitt pass."
}
[10]=>
object(stdClass)#18904 (3) {
["id"]=>
int(3953)
["key"]=>
string(12) "Sätt kryss:"
["value"]=>
string(88) "Jag har förstått villkoren för användning av Japan Rail Pass som japansk medborgare."
}
[11]=>
object(stdClass)#18903 (3) {
["id"]=>
int(3954)
["key"]=>
string(12) "Sätt kryss:"
["value"]=>
string(84) "Jag förstår att det är mitt ansvar att se till att jag har korrekt dokumentation."
}