Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:08:21+00:00 2026-06-14T09:08:21+00:00

i am trying to get custom option values from sales order items. i wrote

  • 0

i am trying to get custom option values from sales order items. i wrote a code as below

foreach ($order->getAllItems() as $item){
  $productOptions = $item->getProductOptions(); 
   foreach($productOptions as $opt){
     var_dump($opt);
    }  
  }

but i don’t know ho to access single options through this array.
ex- $opt->Title

not getting anything for me

here is var dump for one item

array(7) { ["uenc"]=> string(80) "aHR0cDovL3ZhbmhhZ2UuY2FtZm9saW8uY28udWsvc2hvcC1vbmxpbmUvbG95YWx0eS1jYXJkLmh0bWw," ["product"]=> string(4) "1841" ["related_product"]=> string(0) "" ["super_attribute"]=> array(1) { [1000]=> string(5) "11160" } ["options"]=> array(13) { [1574]=> string(2) "Mr" [1575]=> string(7) "Cameron" [1576]=> string(4) "Owen" [1577]=> string(1) "6" [1578]=> string(14) "Address Line 1" [1579]=> string(14) "Address Line 2" [1580]=> string(4) "Town" [1581]=> string(6) "County" [1582]=> string(7) "B17 6AG" [1583]=> string(12) "0121 424 578" [1584]=> string(11) "07811877865" [1585]=> string(10) "19/04/1987" [1573]=> string(20) "hello@camfolio.co.uk" } ["cpid"]=> string(4) "1840" ["qty"]=> int(1) } array(13) { [0]=> array(7) { ["label"]=> string(5) "Title" ["value"]=> string(2) "Mr" ["print_value"]=> string(2) "Mr" ["option_id"]=> string(4) "1574" ["option_type"]=> string(5) "field" ["option_value"]=> string(2) "Mr" ["custom_view"]=> bool(false) } [1]=> array(7) { ["label"]=> string(10) "First Name" ["value"]=> string(7) "Cameron" ["print_value"]=> string(7) "Cameron" ["option_id"]=> string(4) "1575" ["option_type"]=> string(5) "field" ["option_value"]=> string(7) "Cameron" ["custom_view"]=> bool(false) } [2]=> array(7) { ["label"]=> string(9) "Last Name" ["value"]=> string(4) "Owen" ["print_value"]=> string(4) "Owen" ["option_id"]=> string(4) "1576" ["option_type"]=> string(5) "field" ["option_value"]=> string(4) "Owen" ["custom_view"]=> bool(false) } [3]=> array(7) { ["label"]=> string(12) "House Number" ["value"]=> string(1) "6" ["print_value"]=> string(1) "6" ["option_id"]=> string(4) "1577" ["option_type"]=> string(5) "field" ["option_value"]=> string(1) "6" ["custom_view"]=> bool(false) } [4]=> array(7) { ["label"]=> string(14) "Address Line 1" ["value"]=> string(14) "Address Line 1" ["print_value"]=> string(14) "Address Line 1" ["option_id"]=> string(4) "1578" ["option_type"]=> string(5) "field" ["option_value"]=> string(14) "Address Line 1" ["custom_view"]=> bool(false) } [5]=> array(7) { ["label"]=> string(14) "Address Line 2" ["value"]=> string(14) "Address Line 2" ["print_value"]=> string(14) "Address Line 2" ["option_id"]=> string(4) "1579" ["option_type"]=> string(5) "field" ["option_value"]=> string(14) "Address Line 2" ["custom_view"]=> bool(false) } [6]=> array(7) { ["label"]=> string(4) "Town" ["value"]=> string(4) "Town" ["print_value"]=> string(4) "Town" ["option_id"]=> string(4) "1580" ["option_type"]=> string(5) "field" ["option_value"]=> string(4) "Town" ["custom_view"]=> bool(false) } [7]=> array(7) { ["label"]=> string(6) "County" ["value"]=> string(6) "County" ["print_value"]=> string(6) "County" ["option_id"]=> string(4) "1581" ["option_type"]=> string(5) "field" ["option_value"]=> string(6) "County" ["custom_view"]=> bool(false) } [8]=> array(7) { ["label"]=> string(8) "Postcode" ["value"]=> string(7) "B17 6AG" ["print_value"]=> string(7) "B17 6AG" ["option_id"]=> string(4) "1582" ["option_type"]=> string(5) "field" ["option_value"]=> string(7) "B17 6AG" ["custom_view"]=> bool(false) } [9]=> array(7) { ["label"]=> string(16) "Telephone Number" ["value"]=> string(12) "0121 424 578" ["print_value"]=> string(12) "0121 424 578" ["option_id"]=> string(4) "1583" ["option_type"]=> string(5) "field" ["option_value"]=> string(12) "0121 424 578" ["custom_view"]=> bool(false) } [10]=> array(7) { ["label"]=> string(13) "Mobile Number" ["value"]=> string(11) "07811877865" ["print_value"]=> string(11) "07811877865" ["option_id"]=> string(4) "1584" ["option_type"]=> string(5) "field" ["option_value"]=> string(11) "07811877865" ["custom_view"]=> bool(false) } [11]=> array(7) { ["label"]=> string(13) "Date of Birth" ["value"]=> string(10) "19/04/1987" ["print_value"]=> string(10) "19/04/1987" ["option_id"]=> string(4) "1585" ["option_type"]=> string(5) "field" ["option_value"]=> string(10) "19/04/1987" ["custom_view"]=> bool(false) } [12]=> array(7) { ["label"]=> string(13) "Email Address" ["value"]=> string(20) "hello@camfolio.co.uk" ["print_value"]=> string(20) "hello@camfolio.co.uk" ["option_id"]=> string(4) "1573" ["option_type"]=> string(5) "field" ["option_value"]=> string(20) "hello@camfolio.co.uk" ["custom_view"]=> bool(false) } } 

can anyone help me for get the datas from this
ex
Email Address
Date of Birth
etc….

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:08:22+00:00Added an answer on June 14, 2026 at 9:08 am

    $opt is a multidimensional array.

    So if you want to access the first name, you would use:

    $options=$opt['options'];
    $name=$options[1575];
    

    But this can be hard work. I really suggest you create a class (if there isn’t one) and deserialize an object out of $opt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get a custom Value from the Custom Field that
I'm trying to put all the values from a postmeta key into a foreach
Im trying to get a custom menu to show when the menu button is
I am trying to get a custom icon onto my JFrame . I have
I'm trying to get a custom handler to work for a specific URL (or
Ok, so I'm trying to get my custom paging going on the Telerik RadGrid
I'm just trying to get a simple example of accessing a custom java class
I am trying to get my Blackberry application to display a custom modal dialog,
I'm making a custom event calendar with PHP. I am trying to get the
i am trying to write a custom event which should get fire when user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.