Array of array values - php

I am unable to get stores and store_id from this array. Please help me, how to get stores and store_id from this array of arrays?
Array
(
[group_data] => Uni_Banner_Model_Bannergroup Object
(
[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => banner/bannergroup
[_resource:protected] =>
[_resourceCollectionName:protected] => banner/bannergroup_collection
[_cacheTag:protected] =>
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[group_id] => 4
[group_name] => list banner1
[group_code] => list_banner1
[banner_width] => 320
[banner_height] => 460
[animation_type] => 1
[banner_effects] => Fade/Appear
[pre_banner_effects] =>
[banner_ids] => 1
[show_title] => 0
[show_content] => 0
[link_target] => 0
[status] => 1
[created_time] => 2015-03-04 14:47:40
[update_time] => 2015-03-04 14:47:40
)
[_hasDataChanges:protected] => 1
[_origData:protected] => Array
(
[group_id] => 4
[group_name] => list banner1
[group_code] => list_banner1
[banner_width] => 320
[banner_height] => 460
[animation_type] => 1
[banner_effects] => Fade/Appear
[pre_banner_effects] =>
[banner_ids] => 1
[show_title] => 0
[show_content] => 0
[link_target] => 0
[status] => 1
[created_time] => 2015-03-04 14:47:40
[update_time] => 2015-03-04 14:47:40
)
[_idFieldName:protected] => group_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
[banner_data] => Array
(
[0] => Uni_Banner_Model_Banner Object
(
[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => banner/banner
[_resource:protected] =>
[_resourceCollectionName:protected] => banner/banner_collection
[_cacheTag:protected] =>
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[banner_id] => 1
[title] => List Banner
[filename] => custom/banners/File-1440417903.jpg
[link] => http://localhost/magentonew/french/
[banner_content] =>
[stores] => 4,6
[storeviews] =>
[status] => 1
[sort_order] => 0
[banner_type] => 0
[created_time] => 2015-08-25 16:44:46
[update_time] => 2015-08-25 16:44:46
[store_id] => Array
(
[0] => 4
[1] => 6
)
)
[_hasDataChanges:protected] => 1
[_origData:protected] => Array
(
[banner_id] => 1
[title] => List Banner
[filename] => custom/banners/File-1440417903.jpg
[link] => http://localhost/magentonew/french/
[banner_content] =>
[stores] => 4,6
[storeviews] =>
[status] => 1
[sort_order] => 0
[banner_type] => 0
[created_time] => 2015-08-25 16:44:46
[update_time] => 2015-08-25 16:44:46
[store_id] => Array
(
[0] => 4
[1] => 6
)
)
[_idFieldName:protected] => banner_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
)
)

This is the code get the data for this specific array and objects. You should really use some getter methods for the objects and iterate the array(s) properly.
$arr = your array
$arr['banner_data'][0]->_data['stores'] and
$arr['banner_data'][0]->_data['store_id'][0]
$arr['banner_data'][0]->_data['store_id'][1]

Related

How to print complicated multidimensional array through foreach loop in php

I have an Multi Dimensional array like below.
<?php$array = Array ( [ResultIndex] => OB4 [Source] => 3 [IsLCC] => 1 [IsRefundable] => [GSTAllowed] => [AirlineRemark] => this is a test from aditya [Fare] => Array ( [Currency] => INR [BaseFare] => 865 [Tax] => 613 [TaxBreakup] => Array ( [0] => Array ( [key] => YQTax [value] => 0 ) [1] => Array ( [key] => YR [value] => 0 ) [2] => Array ( [key] => PSF [value] => 0 ) [3] => Array ( [key] => UDF [value] => 0 ) [4] => Array ( [key] => JNTax [value] => 52 ) [5] => Array ( [key] => INTax [value] => 0 ) [6] => Array ( [key] => TransactionFee [value] => 0 ) [7] => Array ( [key] => OtherTaxes [value] => 0 ) ) [YQTax] => 0 [AdditionalTxnFeeOfrd] => 0 [AdditionalTxnFeePub] => 0 [PGCharge] => 0 [OtherCharges] => 0 [ChargeBU] => Array ( [0] => Array ( [key] => TBOMARKUP [value] => 0 ) [1] => Array ( [key] => CONVENIENCECHARGE [value] => 0 ) [2] => Array ( [key] => OTHERCHARGE [value] => 0 ) ) [Discount] => 0 [PublishedFare] => 1478 [CommissionEarned] => 22.06 [PLBEarned] => 14.09 [IncentiveEarned] => 14.33 [OfferedFare] => 1427.52 [TdsOnCommission] => 4.41 [TdsOnPLB] => 2.82 [TdsOnIncentive] => 2.87 [ServiceFee] => 0 [TotalBaggageCharges] => 0 [TotalMealCharges] => 0 [TotalSeatCharges] => 0 [TotalSpecialServiceCharges] => 0 ) [FareBreakdown] => Array ( [0] => Array ( [Currency] => INR [PassengerType] => 1 [PassengerCount] => 1 [BaseFare] => 865 [Tax] => 613 [YQTax] => 0 [AdditionalTxnFeeOfrd] => 0 [AdditionalTxnFeePub] => 0 [PGCharge] => 0 ) ) [Segments] => Array ( [0] => Array ( [0] => Array ( [Baggage] => 10 Kg [CabinBaggage] => 7 Kg [TripIndicator] => 1 [SegmentIndicator] => 1 [Airline] => Array ( [AirlineCode] => SG [AirlineName] => SpiceJet [FlightNumber] => 1033 [FareClass] => C [OperatingCarrier] => ) [NoOfSeatAvailable] => 4 [Origin] => Array ( [Airport] => Array ( [AirportCode] => BLR [AirportName] => Hindustan [Terminal] => [CityCode] => BLR [CityName] => Bangalore [CountryCode] => IN [CountryName] => India ) [DepTime] => 2017-10-21T17:40:00 ) [Destination] => Array ( [Airport] => Array ( [AirportCode] => MAA [AirportName] => Chennai [Terminal] => [CityCode] => MAA [CityName] => Chennai [CountryCode] => IN [CountryName] => India ) [ArrTime] => 2017-10-21T18:40:00 ) [Duration] => 60 [GroundTime] => 0 [Mile] => 0 [StopOver] => [StopPoint] => [StopPointArrivalTime] => 2017-10-21T18:40:00 [StopPointDepartureTime] => 2017-10-21T17:40:00 [Craft] => DH8 [Remark] => [IsETicketEligible] => 1 [FlightStatus] => Confirmed [Status] => ) ) ) [LastTicketDate] => [TicketAdvisory] => [FareRules] => Array ( [0] => Array ( [Origin] => BLR [Destination] => MAA [Airline] => SG [FareBasisCode] => CSAVER [FareRuleDetail] => [FareRestriction] => ) ) [AirlineCode] => SG [ValidatingAirline] => SG );?>
how to make it print using foreach loop in php. if any one have idea to rectify this please suggest me

PHP5.3 json_encode is outputting bad json

I am attempting to json_encode an array in php5.3.
json_encode($paperwork_info[0])
The result is bad json. The array is as follows:
[paperwork_guid] => c5bfe512-908d-c513-5a5e-e3a2fbb5548b
[name] => recycle
[sections] => Array
(
[0] => header
[1] => customer
[2] => scope_bullets
[3] => product
[4] => signature
[5] => installer
[6] => order_data
)
[data] => Array
(
[header] => Array
(
[image] => Array
(
[src] => recycle.png
[format] => float:left
)
)
[customer] => Array
(
[f_name] => TEST ONLY
[l_name] => NEIMEIER
[middle_name] => none
[title] => none
[address1] => 28 OEHMAN BLVD
[address2] =>
[address3] =>
[zip] => 14225
[city] => BUFFALO
[state_abbrev] => NY
[email_address] => DALE.NEIMEIER#INSTALLS.COM
[phones] => Array
(
[alt] =>
[cell] =>
[work] =>
[home] => 7165551212
)
)
[scope_bullets] => Array
(
[sku_3001] => Array
(
[bullet_0] => Array
(
[paperwork_bullet_obj_guid] => 2ebefa96-6f6b-069e-e194-245d138b9845
[ordering] => 1
[bullet_text] => This is bullet point #1
[child_level] => 1
[formatting] => Array
(
[0] => Array
(
[start_word] => 2
[num_words] => 0
[tag] => b
[href] =>
)
[1] => Array
(
[start_word] => 2
[num_words] => 1
[tag] => a
[href] => http://www.cnn.com
)
)
)
[bullet_1] => Array
(
[paperwork_bullet_obj_guid] => 734db3f4-01a0-b025-9624-cc52a1845dff
[ordering] => 1
[bullet_text] => Sub-point #1.1
[child_level] => 2
)
[bullet_2] => Array
(
[paperwork_bullet_obj_guid] => ebf5ef02-906e-2005-e499-27eae2edefe9
[ordering] => 1
[bullet_text] => Sub point #1.1.1
[child_level] => 3
)
[bullet_3] => Array
(
[paperwork_bullet_obj_guid] => 447997c1-fd9c-25be-b9bf-39257009fb8b
[ordering] => 1
[bullet_text] => This is bullet point #2
[child_level] => 1
)
[bullet_4] => Array
(
[paperwork_bullet_obj_guid] => 5def2d9c-d322-788c-0afe-d13707004b97
[ordering] => 1
[bullet_text] => Sub point #2.1
[child_level] => 2
)
[bullet_5] => Array
(
[paperwork_bullet_obj_guid] => 84936151-65a3-bcca-951f-b69ff16d34ec
[ordering] => 2
[bullet_text] => Sub point #2.2
[child_level] => 2
)
)
[sku_4405] =>
)
[product] => Array
(
[0] => Array
(
[model] => Paperwork Test abc123
[serial] => 777333
[weight] => 26
[size] =>
[width] =>
[height] => 32
[num_boxes] => 1
[product_name] =>
[sku] =>
[model_number] =>
[part_number] =>
[serial_number] =>
[cat_value] => Best Buy Equipment
[product] =>
[product_type] =>
[product_size] =>
[category] =>
)
)
[signature] => Array
(
[date] => 2016-06-15
[need_customer] => 1
[need_tech] => 1
[need_store] =>
[need_warehouse] =>
)
[installer] => Array
(
[anum] => 45455
[inst_obj_guid] => fb91cf85-381c-b740-e063-775151743da2
[phone] => (317) 519-0481
[tech_f_name] =>
[tech_l_name] =>
[company_name] => ZICO LLC
[email_address] => ZICOLLC#GMAIL.COM
)
[order_data] => Array
(
[assigned_date] => 2016-06-07 22:24:47-04
[purchased_date] => 2016-06-06
[creation_date] => 2016-06-06
[install_date] => 2016-06-10
[install_time] => 19:00:00
[prescheduled_date] => 1969-12-31
[prom_start_time] => 2016-06-10 08:06:00
[prom_end_time] => 2016-06-10 11:06:00
[client_order_id] => 12365478996325412
[job_num] => 4043269
[campaign_wkord_obj_guid] => a9a8cc0b-d7ef-ac0e-df61-dad41c023cb0
[pos_obj_guid] => 096e38c2-55c3-80cf-0778-23f81f1cf2f6
[inst_obj_guid] => fb91cf85-381c-b740-e063-775151743da2
[client_obj_guid] => 247e893a-3ea4-c544-47b2-f23ff16017c6
[ord_obj_guid] => ae55e034-d7d0-5d13-3dd3-22f99df8ead4
[skus] => Array
(
[0] => Array
(
[job_type_obj_guid] => 8234ca2c-e40e-c48c-befc-7ceac5e9de32
[job_sku] => 3001
[client_sku] =>
[sku_name] => Site Survey
)
[1] => Array
(
[job_type_obj_guid] => a3f60c3b-ad3c-d828-9898-fa200edcd3cd
[job_sku] => 4405
[client_sku] =>
[sku_name] => Home Delivery
)
)
[client_specific_data] =>
)
)
)
The resultant json string is as follows:
{"paperwork_guid":"c5bfe512-908d-c513-5a5e-e3a2fbb5548b","name":"recycle","sections":{"0":"header","1"
:"customer","2":"scope_bullets","3":"product","4":"signature","5":"installer","6":"order_data"},"data"
:{"header":{"image":{"src":"recycle.png","format":"float:left"}},"customer":{"f_name":"TEST ONLY","l_name"
:"NEIMEIER","middle_name":"none","title":"none","address1":"28 OEHMAN BLVD","address2":"","address3"
:null,"zip":"14225","city":"BUFFALO","state_abbrev":"NY","email_address":"DALE.NEIMEIER#INSTALLS.COM"
,"phones":{"alt":"","cell":"","work":"","home":"7165551212"}},"scope_bullets":{"sku_3001":{"bullet_0"
:{"paperwork_bullet_obj_guid":"2ebefa96-6f6b-069e-e194-245d138b9845","ordering":"1","bullet_text":"This
is bullet point #1","child_level":"1","formatting":{"0":{"start_word":"2","num_words":"0","tag":"b"
,"href":""},"1":{"start_word":"2","num_words":"1","tag":"a","href":"http:\/\/www.cnn.com"}}},"bullet_1"
:{"paperwork_bullet_obj_guid":"734db3f4-01a0-b025-9624-cc52a1845dff","ordering":"1","bullet_text":"Sub-point
#1.1","child_level":"2"},"bullet_2":{"paperwork_bullet_obj_guid":"ebf5ef02-906e-2005-e499-27eae2edefe9"
,"ordering":"1","bullet_text":"Sub point #1.1.1","child_level":"3"},"bullet_3":{"paperwork_bullet_obj_guid"
:"447997c1-fd9c-25be-b9bf-39257009fb8b","ordering":"1","bullet_text":"This is bullet point #2","child_level"
:"1"},"bullet_4":{"paperwork_bullet_obj_guid":"5def2d9c-d322-788c-0afe-d13707004b97","ordering":"1","bullet_text"
:"Sub point #2.1","child_level":"2"},"bullet_5":{"paperwork_bullet_obj_guid":"84936151-65a3-bcca-951f-b69ff16d34ec"
,"ordering":"2","bullet_text":"Sub point #2.2","child_level":"2"}},"sku_4405":null},"product":{"0":{"model"
:"Paperwork Test abc123","serial":"777333","weight":"26","size":null,"width":null,"height":"32","num_boxes"
:"1","product_name":null,"sku":null,"model_number":null,"part_number":null,"serial_number":null,"cat_value"
:"Best Buy Equipment","product":null,"product_type":null,"product_size":null,"category":null}},"signature"
:{"date":"2016-06-15","need_customer":true,"need_tech":true,"need_store":false,"need_warehouse":false
},"installer":{"anum":"45455","inst_obj_guid":"fb91cf85-381c-b740-e063-775151743da2","phone":"(317) 519-0481"
,"tech_f_name":null,"tech_l_name":null,"company_name":"ZICO LLC","email_address":"ZICOLLC#GMAIL.COM"
},"order_data":{"assigned_date":"2016-06-07 22:24:47-04","purchased_date":"2016-06-06","creation_date"
:"2016-06-06","install_date":"2016-06-10","install_time":"19:00:00","prescheduled_date":"1969-12-31"
,"prom_start_time":"2016-06-10 08:06:00","prom_end_time":"2016-06-10 11:06:00","client_order_id":"12365478996325412"
,"job_num":"4043269","campaign_wkord_obj_guid":"a9a8cc0b-d7ef-ac0e-df61-dad41c023cb0","pos_obj_guid"
:"096e38c2-55c3-80cf-0778-23f81f1cf2f6","inst_obj_guid":"fb91cf85-381c-b740-e063-775151743da2","client_obj_guid"
:"247e893a-3ea4-c544-47b2-f23ff16017c6","ord_obj_guid":"ae55e034-d7d0-5d13-3dd3-22f99df8ead4","skus"
:{"0":{"job_type_obj_guid":"8234ca2c-e40e-c48c-befc-7ceac5e9de32","job_sku":"3001","client_sku":null
,"sku_name":"Site Survey"},"1":{"job_type_obj_guid":"a3f60c3b-ad3c-d828-9898-fa200edcd3cd","job_sku"
:"4405","client_sku":null,"sku_name":"Home Delivery"}},"client_specific_data":""}}}
It appears as though new line feeds are being inserted randomly throughout the josn string. I am not sure if it is just how firebug is outputting the string, but copying-and-pasting the string into jsonLINT produces errors.
Any help would be appreciated.

how to print multiple array in joomla

This is the cart array in the Virtuemart 2.0.22a ..
this is stored in "$cart"
how to print [virtuemart_product_id] => 21 at 4.
$cart=
VirtueMartCart Object
(
[products] => Array
(
[21] => stdClass Object
(
[virtuemart_manufacturer_id] => Array
(
)
[slug] => stylish-shirt
[published] => 1
[virtuemart_product_price] =>
[virtuemart_product_id] => 21
[virtuemart_shoppergroup_id] =>
[product_price] => 450.00000
[override] => 0
[product_override_price] => 0.00000
[product_tax_id] => -1
[product_discount_id] => -1
[product_currency] => 68
[virtuemart_vendor_id] => 1
[product_parent_id] => 0
[product_sku] =>
[product_name] => Stylish Shirt
[product_s_desc] =>
[product_weight] =>
[product_weight_uom] => KG
[product_length] =>
[product_width] =>
[product_height] =>
[product_lwh_uom] => M
[product_in_stock] => 0
[product_ordered] => 0
[product_sales] => 0
[product_unit] => KG
[product_packaging] =>
[min_order_level] =>
[max_order_level] =>
[virtuemart_media_id] => Array
(
[0] => 21
)
[step_order_level] =>
[image] => VmImage Object
(
[media_attributes] => 0
[setRole] =>
[file_name] => 3
[file_extension] => jpg
[virtuemart_media_id] => 21
[_foldersToTest:VmMediaHandler:private] => Array
(
[0] => E:\wamp\www\ecomm\images\stories\virtuemart\product\
[1] => E:\wamp\www\ecomm\images\stories\virtuemart\product\resized\
)
[_actions:VmMediaHandler:private] => Array
(
)
[_mLocation:VmMediaHandler:private] => Array
(
)
[_hidden:VmMediaHandler:private] => Array
(
)
[theme_url] => http://localhost/ecomm/components/com_virtuemart/
[virtuemart_vendor_id] => 1
[file_title] => 3.jpg
[file_description] =>
[file_meta] =>
[file_mimetype] => image/jpeg
[file_type] => product
[file_url] => images/stories/virtuemart/product/3.jpg
[file_url_thumb] => images/stories/virtuemart/product/resized/3_90x90.jpg
[published] => 1
[file_is_downloadable] => 0
[file_is_forSale] => 0
[file_is_product_image] => 0
[shared] => 0
[file_params] =>
[file_lang] =>
[_translatable] =>
[_tablePreFix] =>
[created_on] => 2013-08-12 12:32:19
[created_by] => 572
[modified_on] => 2013-08-12 12:38:50
[modified_by] => 572
[file_url_folder] => images/stories/virtuemart/product/
[file_path_folder] => images\stories\virtuemart\product\
[file_url_folder_thumb] => images/stories/virtuemart/product/resized/
[media_role] => file_is_displayable
[file_name_thumb] => 3_90x90
)
[categories] => Array
(
[0] => 6
)
[virtuemart_category_id] => 6
[category_name] => Shirts
[link] => /ecomm/index.php/component/virtuemart/shirts/stylish-shirt-detail?Itemid=0
[packaging] =>
[quantity] => 1
)
)
[_inCheckOut] =>
[_dataValidated] =>
[_blockConfirm] =>
[_confirmDone] =>
[_redirect] =>
[_redirect_disabled] =>
[_lastError] =>
[vendorId] => 1
[lastVisitedCategoryId] => 0
[virtuemart_shipmentmethod_id] => 0
[virtuemart_paymentmethod_id] => 1
[automaticSelectedShipment] => 1
[automaticSelectedPayment] => 1
[BT] => 0
[ST] => 0
[tosAccepted] =>
[customer_comment] =>
[couponCode] =>
[order_language] =>
[cartData] => Array
(
[VatTax] => Array
(
)
[duty] => 1
[payment] => 0
[paymentName] =>
Finally i got the output.. after lot of struggles
foreach($cart->products as $cur)
{
echo $cur->virtuemart_product_id;
}

how to get an array value on php magento to display magento wishlist image

Hi am customizing magento wishlist and I want to display image on every product on my wishlist.
currently the products display the default image (no image).
in my view.phtml in wishlist directory this my code
foreach($this->getWishlist() as $item){
// ... some code
<img src="<?php echo $this->helper('catalog/image')->init($item, 'small_image')->resize(113, 113)*/?>" alt="<?php echo $item->getName();?>" width="113"/>
// the image that always shows the no image, it does not display the product image..
// I think there is something wrong with $this->helper('catalog/image')->init($item, 'small_image')->resize(113, 113)
// i try to print thr $item
print_r($item);
}
this is the result
Mage_Wishlist_Model_Item Object
(
[_customOptionDownloadUrl:protected] => wishlist/index/downloadCustomOption
[_eventPrefix:protected] => wishlist_item
[_eventObject:protected] => item
[_options:protected] => Array
(
[0] => Mage_Wishlist_Model_Item_Option Object
(
[_item:protected] => Mage_Wishlist_Model_Item Object
*RECURSION*
[_product:protected] =>
[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => wishlist/item_option
[_resource:protected] =>
[_resourceCollectionName:protected] => wishlist/item_option_collection
[_cacheTag:protected] =>
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[option_id] => 26
[wishlist_item_id] => 26
[product_id] => 6767
[code] => info_buyRequest
[value] => a:1:{s:7:"product";s:4:"6767";}
)
[_hasDataChanges:protected] => 1
[_origData:protected] => Array
(
[option_id] => 26
[wishlist_item_id] => 26
[product_id] => 6767
[code] => info_buyRequest
[value] => a:1:{s:7:"product";s:4:"6767";}
)
[_idFieldName:protected] => option_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
)
[_optionsByCode:protected] => Array
(
[info_buyRequest] => Mage_Wishlist_Model_Item_Option Object
(
[_item:protected] => Mage_Wishlist_Model_Item Object
*RECURSION*
[_product:protected] =>
[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => wishlist/item_option
[_resource:protected] =>
[_resourceCollectionName:protected] => wishlist/item_option_collection
[_cacheTag:protected] =>
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[option_id] => 26
[wishlist_item_id] => 26
[product_id] => 6767
[code] => info_buyRequest
[value] => a:1:{s:7:"product";s:4:"6767";}
)
[_hasDataChanges:protected] => 1
[_origData:protected] => Array
(
[option_id] => 26
[wishlist_item_id] => 26
[product_id] => 6767
[code] => info_buyRequest
[value] => a:1:{s:7:"product";s:4:"6767";}
)
[_idFieldName:protected] => option_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
)
[_notRepresentOptions:protected] => Array
(
[0] => info_buyRequest
)
[_flagOptionsSaved:protected] =>
[_resourceName:protected] => wishlist/item
[_resource:protected] =>
[_resourceCollectionName:protected] => wishlist/item_collection
[_cacheTag:protected] =>
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[wishlist_item_id] => 26
[wishlist_id] => 5
[product_id] => 6767
[store_id] => 1
[added_at] => 2013-06-11 03:14:04
[description] =>
[qty] => 1.0000
[product] => Mage_Catalog_Model_Product Object
(
[_cacheTag:protected] => catalog_product
[_eventPrefix:protected] => catalog_product
[_eventObject:protected] => product
[_canAffectOptions:protected] =>
[_typeInstance:protected] =>
[_typeInstanceSingleton:protected] =>
[_linkInstance:protected] =>
[_customOptions:protected] => Array
(
)
[_urlModel:protected] =>
[_errors:protected] => Array
(
)
[_optionInstance:protected] =>
[_options:protected] => Array
(
)
[_reservedAttributes:protected] =>
[_isDuplicable:protected] => 1
[_calculatePrice:protected] => 1
[_defaultValues:protected] => Array
(
)
[_storeValuesFlags:protected] => Array
(
)
[_lockedAttributes:protected] => Array
(
)
[_isDeleteable:protected] => 1
[_isReadonly:protected] =>
[_resourceName:protected] => catalog/product
[_resource:protected] =>
[_resourceCollectionName:protected] => catalog/product_collection
[_dataSaveAllowed:protected] => 1
[_isObjectNew:protected] =>
[_data:protected] => Array
(
[entity_id] => 6767
[entity_type_id] => 4
[attribute_set_id] => 4
[type_id] => simple
[sku] => sku6768
[has_options] => 0
[required_options] => 0
[created_at] => 2011-07-25 19:46:25
[updated_at] => 2013-06-03 21:08:50
[cat_index_position] => 80000
[price] => 0.0000
[tax_class_id] => 2
[final_price] => 0.0000
[minimal_price] => 0.0000
[min_price] => 0.0000
[max_price] => 0.0000
[tier_price] =>
[image_label] => Amplifier +15V Input
[manufacturer2] => 130
[name] => Amplifier +15V Input
[small_image] => /d/s/dsc00394.jpg
[small_image_label] => Amplifier +15V Input
[thumbnail] => /d/s/dsc00394.jpg
[thumbnail_label] => Amplifier +15V Input
[url_key] => amplifier-15v-input
[url_path] => amplifier-15v-input.html
[short_description] => <p> </p>
[status] => 1
[visibility] => 4
[is_salable] => 1
[stock_item] => Varien_Object Object
(
[_data:protected] => Array
(
[is_in_stock] => 1
)
[_hasDataChanges:protected] =>
[_origData:protected] =>
[_idFieldName:protected] =>
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
[request_path] => amplifier-15v-input.html
)
[_hasDataChanges:protected] => 1
[_origData:protected] =>
[_idFieldName:protected] => entity_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
[product_name] => Amplifier +15V Input
[name] => Amplifier +15V Input
[price] => 0.0000
)
[_hasDataChanges:protected] =>
[_origData:protected] => Array
(
[wishlist_item_id] => 26
[wishlist_id] => 5
[product_id] => 6767
[store_id] => 1
[added_at] => 2013-06-11 03:14:04
[description] =>
[qty] => 1.0000
)
[_idFieldName:protected] => wishlist_item_id
[_isDeleted:protected] =>
[_oldFieldsMap:protected] => Array
(
)
[_syncFieldsMap:protected] => Array
(
)
)
now, my problem is how can I query or get the [_resourceName:protected] => catalog/product and [small_image] => /d/s/dsc00394.jpg from the print_r($item); ?
i just want it to be print on my image source, does anyone has an idea about my case?
thanks in advance ....
I got the solution about this, I try this.
foreach ($item->_data as $item_img){
echo $item_img->_data[small_image];
}

PHP Acess multi array object of WP Shopping Cart items

I have array which gets from session, this is print_r of array
print_r($_SESSION['wpsc_cart']);
wpsc_cart Object ( [delivery_country] => AU [selected_country] => AU [delivery_region] => [selected_region] => [selected_shipping_method] => [selected_shipping_option] => [selected_shipping_amount] => [coupon] => [tax_percentage] => 0 [unique_id] => 98b4abe821cda949c0a6feedcd51487134765124 [errors] => Array ( ) [total_tax] => [base_shipping] => [total_item_shipping] => [total_shipping] => [subtotal] => 105 [total_price] => [uses_shipping] => [is_incomplete] => 1 [cart_items] => Array ( [0] => wpsc_cart_item Object ( [cart] => wpsc_cart Object *RECURSION* [product_id] => 1675 [variation_values] => [product_variations] => [variation_data] => [quantity] => 1 [provided_price] => [product_name] => Gift Card [category_list] => Array ( [0] => 30 ) [category_id_list] => Array ( [0] => 13 ) [unit_price] => 30 [total_price] => 30 [taxable_price] => 0 [tax] => 0 [weight] => 0 [shipping] => 0 [sku] => [product_url] => http://www.activefeet.com.au/products-page/30/gift-card [image_id] => [thumbnail_image] => [custom_tax_rate] => [meta] => Array ( [0] => Array ( [wpec_taxes_taxable_amount] => [external_link] => [external_link_text] => [external_link_target] => [weight] => 0 [weight_unit] => pound [dimensions] => Array ( [height] => 0 [height_unit] => in [width] => 0 [width_unit] => in [length] => 0 [length_unit] => in ) [shipping] => Array ( [local] => 5 [international] => 5 ) [no_shipping] => 1 [merchant_notes] => [engraved] => 0 [can_have_uploaded_image] => 0 [enable_comments] => [unpublish_when_none_left] => 0 [quantity_limited] => 0 [special] => 0 [display_weight_as] => pound [table_rate_price] => Array ( [quantity] => Array ( ) [table_price] => Array ( ) ) [google_prohibited] => 0 ) ) [is_donation] => 0 [apply_tax] => 1 [priceandstock_id] => 0 [custom_message] => [custom_file] => [comment] => [time_requested] => [file_data] => [is_customisable] => [stock] => [uses_shipping] => 0 [has_limited_stock] => [file_id] => [is_downloadable] => ) [1] => wpsc_cart_item Object ( [cart] => wpsc_cart Object *RECURSION* [product_id] => 1679 [variation_values] => [product_variations] => [variation_data] => [quantity] => 1 [provided_price] => [product_name] => Gift Card [category_list] => Array ( [0] => 76 ) [category_id_list] => Array ( [0] => 15 ) [unit_price] => 75 [total_price] => 75 [taxable_price] => 0 [tax] => 0 [weight] => 0 [shipping] => 0 [sku] => [product_url] => http://www.activefeet.com.au/products-page/76/gift-card-3 [image_id] => [thumbnail_image] => [custom_tax_rate] => [meta] => Array ( [0] => Array ( [wpec_taxes_taxable_amount] => [external_link] => [external_link_text] => [external_link_target] => [weight] => 0 [weight_unit] => pound [dimensions] => Array ( [height] => 0 [height_unit] => in [width] => 0 [width_unit] => in [length] => 0 [length_unit] => in ) [shipping] => Array ( [local] => 0 [international] => 0 ) [merchant_notes] => [engraved] => 0 [can_have_uploaded_image] => 0 [enable_comments] => [unpublish_when_none_left] => 0 [no_shipping] => 0 [quantity_limited] => 0 [special] => 0 [display_weight_as] => pound [table_rate_price] => Array ( [quantity] => Array ( ) [table_price] => Array ( ) ) [google_prohibited] => 0 ) ) [is_donation] => 0 [apply_tax] => 1 [priceandstock_id] => 0 [custom_message] => [custom_file] => [comment] => [time_requested] => [file_data] => [is_customisable] => [stock] => [uses_shipping] => 1 [has_limited_stock] => [file_id] => [is_downloadable] => ) ) [cart_item] => wpsc_cart_item Object ( [cart] => wpsc_cart Object *RECURSION* [product_id] => 1675 [variation_values] => [product_variations] => [variation_data] => [quantity] => 1 [provided_price] => [product_name] => Gift Card [category_list] => Array ( [0] => 30 ) [category_id_list] => Array ( [0] => 13 ) [unit_price] => 30 [total_price] => 30 [taxable_price] => 0 [tax] => 0 [weight] => 0 [shipping] => 0 [sku] => [product_url] => http://www.activefeet.com.au/products-page/30/gift-card [image_id] => [thumbnail_image] => [custom_tax_rate] => [meta] => Array ( [0] => Array ( [wpec_taxes_taxable_amount] => [external_link] => [external_link_text] => [external_link_target] => [weight] => 0 [weight_unit] => pound [dimensions] => Array ( [height] => 0 [height_unit] => in [width] => 0 [width_unit] => in [length] => 0 [length_unit] => in ) [shipping] => Array ( [local] => 5 [international] => 5 ) [no_shipping] => 1 [merchant_notes] => [engraved] => 0 [can_have_uploaded_image] => 0 [enable_comments] => [unpublish_when_none_left] => 0 [quantity_limited] => 0 [special] => 0 [display_weight_as] => pound [table_rate_price] => Array ( [quantity] => Array ( ) [table_price] => Array ( ) ) [google_prohibited] => 0 ) ) [is_donation] => 0 [apply_tax] => 1 [priceandstock_id] => 0 [custom_message] => [custom_file] => [comment] => [time_requested] => [file_data] => [is_customisable] => [stock] => [uses_shipping] => 0 [has_limited_stock] => [file_id] => [is_downloadable] => ) [cart_item_count] => 2 [current_cart_item] => -1 [in_the_loop] => [shipping_methods] => [shipping_method] => [shipping_method_count] => 1 [current_shipping_method] => -1 [in_the_method_loop] => [shipping_quotes] => [shipping_quote] => [shipping_quote_count] => 0 [current_shipping_quote] => -1 [in_the_quote_loop] => [coupons_name] => [coupons_amount] => 0 [shipping_option] => )
I need to get items from this array
[no_shipping] => 1
[no_shipping] => 0
using some foreach or.. i have no idea about this, please help me..
thank you
i directly use the object, it is easy than convert session to object
foreach($wpsc_cart->cart_items as $i => $Item) {
$cv=$Item->meta;
foreach($cv as $vc=>$it){
echo $it['no_shipping'];
}
}

Categories