2

I want to pull the file location of a user's upload through a Magento observer, but I can't seem to break into some protected data in this output:

[_product:protected] => Mage_Catalog_Model_Product Object
 *RECURSION*
                                                                    [_eventPrefix:protected] => core_abstract
                                                                    [_eventObject:protected] => object
                                                                    [_resourceName:protected] => sales/quote_item_option
                                                                    [_resource:protected] => 
                                                                    [_resourceCollectionName:protected] => sales/quote_item_option_collection
                                                                    [_cacheTag:protected] => 
                                                                    [_dataSaveAllowed:protected] => 1
                                                                    [_isObjectNew:protected] => 
                                                                    [_data:protected] => Array
                                                                        (
                                                                            [option_id] => 203
                                                                            [item_id] => 71
                                                                            [product_id] => 3
                                                                            [code] => option_3
                                                                            [value] => a:9:{s:4:"type";s:24:"application/octet-stream";s:5:"title";s:19:"EatingBreakfast.jpg";s:10:"quote_path";s:68:"\media\custom_options\quote\E\a\9884fbc76ede5ddb9ef991b83c17f8ae.jpg";s:10:"order_path";s:68:"\media\custom_options\order\E\a\9884fbc76ede5ddb9ef991b83c17f8ae.jpg";s:8:"fullpath";s:93:"D:\Our Files\Web\lifewall\media\custom_options\quote\E\a\9884fbc76ede5ddb9ef991b83c17f8ae.jpg";s:4:"size";s:7:"8050795";s:5:"width";i:3000;s:6:"height";i:3997;s:10:"secret_key";s:20:"9884fbc76ede5ddb9ef9";}
                                                                            [product] => Mage_Catalog_Model_Product Object

I'm stumped and frustrated. Just want that URL (for the .jpg file). Thoughts?

2 Answers2

2

Try This

$values  = $object->getData('value');
$values  = unserialize($values); 
Minesh Patel
  • 2,193
  • 12
  • 23
  • That doesn't seem to work. Nothing is outputted to the screen. Here's what I'm using:

    $quote = Mage::getSingleton('checkout/session')->getQuote(); $values = $quote->getData('value'); $values = unserialize($values); print_r($values);

    – Alex MacArthur Oct 17 '15 at 01:11
  • check print_r(get_class_methods($quote)); – Minesh Patel Oct 17 '15 at 04:35
  • I get a list of methods, including getData(), but nothing that seems to indicate why $quote->getData('value') won't work. – Alex MacArthur Oct 17 '15 at 12:42
0

Try This

$values  = $object->getData();
var_dump($values);exit;

Then search for your value in output.

Sanaullah Ahmad
  • 587
  • 1
  • 5
  • 23