count and addition the array values in array php - php

I have one array data output coming below format. i want to add total adults count with in the array.My out is below please find.
Array
(
[0] => stdClass Object
(
[id] => 4534
[api] => expedia
[AL_RefNo] => H190100000062
[modify_refno] => H190100000062_1
[Hotel_RefNo] => 325758353
[Booking_RefNo] => 1234
[affiliateConfirmationId] => OMEIR-1P3IWK2G8UXTIT5E2ELI2T2H1QI4H7
[room_no] => 1
[room_type] => Deluxe Double or Twin Room
[arrivalDate] => 02/20/2019
[departureDate] => 02/21/2019
[nights] => 1
[adults] => 1
[childs] => 2
[childs_ages] => 6,8
[bedTypeId] =>
[rateKey] => 26963a10-0e8d-41e0-ad55-478b8b2280fb
[booking_status] => Confirmed
[first_name] => hjgkjug
[middle_name] =>
[last_name] => jh
[averageBaseRate] => 48.46
[averageRate] => 48.46
[commissionableUsdTotal] => 48.46
[currency_val] => 1
[Currency] => AED
[Xml_Currency] => USD
[eanCompensationOffline] => 0
[eanCompensationOnline] => 0
[maxNightlyRate] => 48.46
[nightlyRateTotal] => 48.46
[grossProfitOffline] => 0
[grossProfitOnline] => 0
[TotalBasePrice] => 61
[TotalEqualBasePrice] =>
[TotalEqualTax] =>
[TotalTax] => 13
[markup_type] =>
[markup_percentage] =>
[markup_amount] =>
[markup_value_amount] => 0
[markup_value_percentage] => 10.0000
[extra_markup] => 0
[extra_markup_percentage] => 0
[markup_effective_to] => 2019-02-27
[markup_per_night] => No
[customer_markup] => 6.107
[ota_discount_amount] => 0.00
[ota_discount_type] =>
[ota_discount_cal_amount] => 0.00
[total] => 70.53585
[dailyPrice] =>
[surchargeTotal] => 12.61
[NightlyRatesPerRoomsize] => 1
[NightlyRatePromo] => false
[baseRate] => 48.46
[rate] => 48.46
[surchargesSize] => 1
[surchargeType] => TaxAndServiceFee
[surchargeAmount] => 12.61
[ratePlanType] =>
[processedWithConfirmation] => true
[booking_date] => 2019-01-17 15:01:01
[remarks] => Refundable
[room_type_code] =>
[rateIdentifier] =>
[status] =>
[roomTotalPrice] =>
[serviceDate] =>
[dailypriceType] =>
[mealBasisCodeDay] =>
[mealIdDay] =>
[mealTypeDay] =>
[descriptionDay] =>
[roomDescription] =>
[roomCategory] =>
[transactionID] =>
[payment_charge] =>
[room_code] =>
[description] =>
[commission] =>
[gross_price] =>
[nett_price] =>
[Cancellation_Charge] =>
[Cancel_Till_Date] =>
[Cancelled_By] =>
[rateClass] =>
[rateComments] =>
[paymentType] =>
[packaging] =>
[cancel_amount] =>
[cancel_from_date] =>
[actual_hotel_confirmation_number] =>
[meal_type] => Free Wireless Internet|Free Breakfast
[supplier_price] =>
[sell_price] =>
[client_price] =>
[total_sell_price] =>
[ota_booking_status] =>
[Cancellation_Status] =>
[Cancellation_Charge_Amount] =>
[Cancelled_Markup] =>
[Cancelled_Extra_Markup] =>
[Refundable_Amont] =>
[room_daily_rates] => [{"offset":1,"providerCost":48.46,"baseRate":48.46,"promo":"false","checkIn":"20-02-2019","totalTax":12.61,"inputVat":0,"markup":6.107,"eMarkup":0,"discount":"","outputVat":3.6642,"totalAmount":70.8412,"status":"A"}]
[vat_effective_to] => 2050-02-01
[vat_price] => 3.36
[vat_percentage] => 5
[input_vat_percentage] => 0
[input_vat_price] => 0
[cost_components] => ["Base Price","Markup"]
[register_supplier] => Yes
[inclusive_vat] => No
[gcc_supplier] =>
[price_rate_with_triple_plus] =>
[hotel_service_percentage] =>
[tourism_fee_percentage] =>
[municipality_fee_percentage] =>
[hotel_service_price] =>
[tourism_fee_price] =>
[municipality_fee_price] =>
[direct_hotel_booking] => No
[supplier_cancellation_charge] =>
[vat_cancellation_charge] =>
[modify_booking_status] =>
[parent_modify_refno] =>
[refundable_status] => Refundable
[modify_status] => Yes
[updated_on] => 2019-01-17 19:56:55
)
[1] => stdClass Object
(
[id] => 4535
[api] => expedia
[AL_RefNo] => H190100000062
[modify_refno] => H190100000062_1
[Hotel_RefNo] => 325758353
[Booking_RefNo] => 1235
[affiliateConfirmationId] => OMEIR-1P3IWK2G8UXTIT5E2ELI2T2H1QI4H7
[room_no] => 2
[room_type] => Deluxe Double or Twin Room
[arrivalDate] => 02/20/2019
[departureDate] => 02/21/2019
[nights] => 1
[adults] => 2
[childs] => 1
[childs_ages] => 10
[bedTypeId] =>
[rateKey] => 5baad87e-8d89-43fc-8553-357e885e7f0c
[booking_status] => Confirmed
[first_name] => hjgkjug
[middle_name] =>
[last_name] => jh
[averageBaseRate] => 48.46
[averageRate] => 48.46
[commissionableUsdTotal] => 48.46
[currency_val] => 1
[Currency] => AED
[Xml_Currency] => USD
[eanCompensationOffline] => 0
[eanCompensationOnline] => 0
[maxNightlyRate] => 48.46
[nightlyRateTotal] => 48.46
[grossProfitOffline] => 0
[grossProfitOnline] => 0
[TotalBasePrice] => 61
[TotalEqualBasePrice] =>
[TotalEqualTax] =>
[TotalTax] => 13
[markup_type] =>
[markup_percentage] =>
[markup_amount] =>
[markup_value_amount] => 0
[markup_value_percentage] => 10.0000
[extra_markup] => 0
[extra_markup_percentage] => 0
[markup_effective_to] => 2019-02-27
[markup_per_night] => No
[customer_markup] => 6.107
[ota_discount_amount] => 0.00
[ota_discount_type] =>
[ota_discount_cal_amount] => 0.00
[total] => 70.53585
[dailyPrice] =>
[surchargeTotal] => 12.61
[NightlyRatesPerRoomsize] => 1
[NightlyRatePromo] => false
[baseRate] => 48.46
[rate] => 48.46
[surchargesSize] => 1
[surchargeType] => TaxAndServiceFee
[surchargeAmount] => 12.61
[ratePlanType] =>
[processedWithConfirmation] => true
[booking_date] => 2019-01-17 15:01:01
[remarks] => Refundable
[room_type_code] =>
[rateIdentifier] =>
[status] =>
[roomTotalPrice] =>
[serviceDate] =>
[dailypriceType] =>
[mealBasisCodeDay] =>
[mealIdDay] =>
[mealTypeDay] =>
[descriptionDay] =>
[roomDescription] =>
[roomCategory] =>
[transactionID] =>
[payment_charge] =>
[room_code] =>
[description] =>
[commission] =>
[gross_price] =>
[nett_price] =>
[Cancellation_Charge] =>
[Cancel_Till_Date] =>
[Cancelled_By] =>
[rateClass] =>
[rateComments] =>
[paymentType] =>
[packaging] =>
[cancel_amount] =>
[cancel_from_date] =>
[actual_hotel_confirmation_number] =>
[meal_type] => Free Wireless Internet|Free Breakfast
[supplier_price] =>
[sell_price] =>
[client_price] =>
[total_sell_price] =>
[ota_booking_status] =>
[Cancellation_Status] =>
[Cancellation_Charge_Amount] =>
[Cancelled_Markup] =>
[Cancelled_Extra_Markup] =>
[Refundable_Amont] =>
[room_daily_rates] => [{"offset":1,"providerCost":48.46,"baseRate":48.46,"promo":"false","checkIn":"20-02-2019","totalTax":12.61,"inputVat":0,"markup":6.107,"eMarkup":0,"discount":"","outputVat":3.6642,"totalAmount":70.8412,"status":"A"}]
[vat_effective_to] => 2050-02-01
[vat_price] => 3.36
[vat_percentage] => 5
[input_vat_percentage] => 0
[input_vat_price] => 0
[cost_components] => ["Base Price","Markup"]
[register_supplier] => Yes
[inclusive_vat] => No
[gcc_supplier] =>
[price_rate_with_triple_plus] =>
[hotel_service_percentage] =>
[tourism_fee_percentage] =>
[municipality_fee_percentage] =>
[hotel_service_price] =>
[tourism_fee_price] =>
[municipality_fee_price] =>
[direct_hotel_booking] => No
[supplier_cancellation_charge] =>
[vat_cancellation_charge] =>
[modify_booking_status] =>
[parent_modify_refno] =>
[refundable_status] => Refundable
[modify_status] => Yes
[updated_on] => 2019-01-17 19:56:55
)
)
Here in array object adults is total 1+2 =3 and childs is total 2+1=3.
i tried below code not working
foreach($room_details as $adultcount){
echo $adultcount->adults;
echo $adultcount->childs;
}
can any one please check and tell me where is the mistake in this code. i tried so many times not working below code.

Try something like this:
$adult_count = 0;
$child_count = 0;
foreach($room_details as $count){
$adult_count += $count->adults;
$child_count += $count->childs;
}
echo $adult_count;
echo $child_count;

Related

PHP, CURL. What does curl_exec returns a string

I'm trying to set an API wit a CMS. The api code works fine. When I use var_dump the data I get is given below. I just want to extract records from it.
string(9219) "{"Details":{"PageNo":1,"TotalRecords":21,"TotalPages":6,"MethodName":"GetEntity"},"Error":{"ErrorCode":"200","ErrorDescription":"Request Successfully Accommodated"},"Records":[{"RecordId":"79245","Deleted":"N","CancellationWithNoRefund":"N","ShowOnWeb":"Y","BookNowOverrideOnWeb":"","WaitingListByEventOrSession":"","Active":"Y","Archive":"","DinnerType":"","StandardDay":"","EvacuationAssistanceRequired":"","IncludesMeals":"","FieldTrip":"","CpdAssignedToDelegate":"","Master":"","EventMaster":"","EnableApologies":"","MemberOnly":"N","AllowTableBooking":"","ExamDate":"","ExpiryDate":"","ArrivalDate":"","DepartDate":"","CutOffDate":"2021-12-20 00:00:00.000","BookingDeadline":"","StartDate":"2021-12-21 00:00:00.000","EndDate":"2021-12-21 00:00:00.000","DateDeleted":"","DateModified":"20/07/2021 14:53:14","DateCreated":"20/07/2021 13:30:11","NoOfDays":"1","AccreditionPoints":"","TotalTba":"0","MaximumSeats":"64","MinimumSeats":"1","TotalBookings":"1","TotalCancellations":"0","TotalRemoved":"","SeatsAvailable":"63","TotalOnWaitingList":"0","WaitingLimitPercentage":"12.5","WaitingLimitNumber":"8","EventCpdHours":"","MaximumAdditionalDelegates":"4","CommitteeName":"","SpeakerTutorOrganisationName":"","EventCode":"","ExpiryDaysName":"","ResponsibilityName":"","JoiningInstructions":"Further instructions will be emailed out ","RegionName":"Southe","Location":"","PromotionalCodeName":"","EventUrl":"","CampaignAppealName":"","CostCentreName":"","InternalId":"","SpeakerTutorName":"","LedgerAccountName":"","MainContactName":"","VatRateName":"Standard 20%","EventTypeName":"Golf Day","EventStatusName":"Open","VenueName":"Foxhills Golf Club & Resort","RegistrationTime":"","DeletedBy":"","EventName":"Golf Day 2021 SL","FomalTitle":"Golf Day 2021 SL","SourceFile":"","EventId":"Golf Day SL ","CreatedBy":"Sarah Lepak","ModifiedBy":"Sarah Lepak","LongDescription":"","Remarks":"","BookNowOverrideMessage":"","AccommodationNotes":"","NotesForWeb":"SL test golf day 2021","TCForWeb":"T's & C's here","ShortNotesForWeb":"","Committee":"","Responsibility":"","PromotionalCode":"","Region":"19053","SpeakerTutorOrganisation":"","ExpiryDays":"","CampaignAppeal":"","CostCentre":"","MainContact":"","Venue":"79240","EventStatus":"241","EventType":"227","LedgerAccount":"","VatRate":"19112","SpeakerTutor":"","StartTime":"10:30","EndTime":"16:00","WaitingListBy":"Event","CpdBy":"","SiteLayout":""},{"RecordId":"79244","Deleted":"N","CancellationWithNoRefund":"N","ShowOnWeb":"Y","BookNowOverrideOnWeb":"","WaitingListByEventOrSession":"","Active":"Y","Archive":"","DinnerType":"","StandardDay":"","EvacuationAssistanceRequired":"","IncludesMeals":"","FieldTrip":"","CpdAssignedToDelegate":"","Master":"","EventMaster":"","EnableApologies":"","MemberOnly":"N","AllowTableBooking":"","ExamDate":"","ExpiryDate":"","ArrivalDate":"","DepartDate":"","CutOffDate":"2021-09-20 00:00:00.000","BookingDeadline":"","StartDate":"2021-09-21 00:00:00.000","EndDate":"2021-09-21 00:00:00.000","DateDeleted":"","DateModified":"20/07/2021 13:30:03","DateCreated":"20/07/2021 13:30:01","NoOfDays":"1","AccreditionPoints":"","TotalTba":"0","MaximumSeats":"64","MinimumSeats":"1","TotalBookings":"0","TotalCancellations":"0","TotalRemoved":"","SeatsAvailable":"64","TotalOnWaitingList":"0","WaitingLimitPercentage":"78.13","WaitingLimitNumber":"50","EventCpdHours":"","MaximumAdditionalDelegates":"4","CommitteeName":"","SpeakerTutorOrganisationName":"","EventCode":"","ExpiryDaysName":"","ResponsibilityName":"","JoiningInstructions":"","RegionName":"Southe","Location":"","PromotionalCodeName":"","EventUrl":"","CampaignAppealName":"","CostCentreName":"","InternalId":"","SpeakerTutorName":"","LedgerAccountName":"","MainContactName":"","VatRateName":"Standard 20%","EventTypeName":"Golf Day","EventStatusName":"Open","VenueName":"Foxhills Golf Club & Resort","RegistrationTime":"","DeletedBy":"","EventName":"CB Golf Experience 2021","FomalTitle":"CB Golf Experience 2021","SourceFile":"","EventId":"CBGE21","CreatedBy":"Calvin Barnett","ModifiedBy":"Calvin Barnett","LongDescription":"","Remarks":"","BookNowOverrideMessage":"","AccommodationNotes":"","NotesForWeb":"Lorem ipsum Lorem ipsum","TCForWeb":"Cancellations more than 14 days ahead of the event will incur an administration fee of 10% per person deducted from their refund\r\n28 days ahead or less - a 50% refund will be given\r\n14 days ahead or less – no refunds will be given","ShortNotesForWeb":"","Committee":"","Responsibility":"","PromotionalCode":"","Region":"19053","SpeakerTutorOrganisation":"","ExpiryDays":"","CampaignAppeal":"","CostCentre":"","MainContact":"","Venue":"79240","EventStatus":"241","EventType":"227","LedgerAccount":"","VatRate":"19112","SpeakerTutor":"","StartTime":"14:00","EndTime":"17:00","WaitingListBy":"Event","CpdBy":"","SiteLayout":""},{"RecordId":"79243","Deleted":"N","CancellationWithNoRefund":"N","ShowOnWeb":"N","BookNowOverrideOnWeb":"","WaitingListByEventOrSession":"","Active":"Y","Archive":"","DinnerType":"","StandardDay":"","EvacuationAssistanceRequired":"","IncludesMeals":"","FieldTrip":"","CpdAssignedToDelegate":"","Master":"","EventMaster":"","EnableApologies":"","MemberOnly":"N","AllowTableBooking":"","ExamDate":"","ExpiryDate":"","ArrivalDate":"","DepartDate":"","CutOffDate":"","BookingDeadline":"","StartDate":"2022-08-30 00:00:00.000","EndDate":"2022-08-30 00:00:00.000","DateDeleted":"","DateModified":"20/07/2021 14:48:13","DateCreated":"20/07/2021 13:29:59","NoOfDays":"1","AccreditionPoints":"","TotalTba":"0","MaximumSeats":"65","MinimumSeats":"1","TotalBookings":"1","TotalCancellations":"0","TotalRemoved":"","SeatsAvailable":"64","TotalOnWaitingList":"0","WaitingLimitPercentage":"","WaitingLimitNumber":"","EventCpdHours":"","MaximumAdditionalDelegates":"4","CommitteeName":"","SpeakerTutorOrganisationName":"","EventCode":"","ExpiryDaysName":"","ResponsibilityName":"","JoiningInstructions":"","RegionName":"Eastmids","Location":"West lobby","PromotionalCodeName":"","EventUrl":"","CampaignAppealName":"","CostCentreName":"","InternalId":"","SpeakerTutorName":"","LedgerAccountName":"","MainContactName":"","VatRateName":"Standard 20%","EventTypeName":"Golf Day","EventStatusName":"Open","VenueName":"MilYork Test Venue","RegistrationTime":"","DeletedBy":"","EventName":"MY Golf Day 2022","FomalTitle":"MY Golf Day 2022","SourceFile":"","EventId":"MYGD22","CreatedBy":"Dawn Hall","ModifiedBy":"Dawn Hall","LongDescription":"","Remarks":"","BookNowOverrideMessage":"","AccommodationNotes":"","NotesForWeb":"Park in West wing carpark","TCForWeb":"This is a CRM test.","ShortNotesForWeb":"","Committee":"","Responsibility":"","PromotionalCode":"","Region":"19046","SpeakerTutorOrganisation":"","ExpiryDays":"","CampaignAppeal":"","CostCentre":"","MainContact":"","Venue":"77113","EventStatus":"241","EventType":"227","LedgerAccount":"","VatRate":"19112","SpeakerTutor":"","StartTime":"08:00","EndTime":"19:00","WaitingListBy":"Session","CpdBy":"","SiteLayout":""},{"RecordId":"79242","Deleted":"N","CancellationWithNoRefund":"N","ShowOnWeb":"Y","BookNowOverrideOnWeb":"","WaitingListByEventOrSession":"","Active":"Y","Archive":"","DinnerType":"","StandardDay":"","EvacuationAssistanceRequired":"","IncludesMeals":"","FieldTrip":"","CpdAssignedToDelegate":"","Master":"","EventMaster":"","EnableApologies":"","MemberOnly":"N","AllowTableBooking":"","ExamDate":"","ExpiryDate":"","ArrivalDate":"","DepartDate":"","CutOffDate":"2021-09-08 00:00:00.000","BookingDeadline":"","StartDate":"2021-09-08 00:00:00.000","EndDate":"2021-09-08 00:00:00.000","DateDeleted":"","DateModified":"20/07/2021 13:29:29","DateCreated":"20/07/2021 13:29:28","NoOfDays":"1","AccreditionPoints":"","TotalTba":"0","MaximumSeats":"64","MinimumSeats":"1","TotalBookings":"0","TotalCancellations":"0","TotalRemoved":"","SeatsAvailable":"64","TotalOnWaitingList":"0","WaitingLimitPercentage":"18.75","WaitingLimitNumber":"12","EventCpdHours":"","MaximumAdditionalDelegates":"4","CommitteeName":"","SpeakerTutorOrganisationName":"","EventCode":"","ExpiryDaysName":"","ResponsibilityName":"","JoiningInstructions":"First come first serve basis","RegionName":"Southe","Location":"","PromotionalCodeName":"","EventUrl":"","CampaignAppealName":"","CostCentreName":"","InternalId":"","SpeakerTutorName":"","LedgerAccountName":"","MainContactName":"","VatRateName":"Standard 20%","EventTypeName":"Golf Day","EventStatusName":"Open","VenueName":"Foxhills Golf Club & Resort","RegistrationTime":"","DeletedBy":"","EventName":"Annual Golf Day 2021 - CL Version","FomalTitle":"Annual Golf Day 2021 - CL Version","SourceFile":"","EventId":"CL- GD21","CreatedBy":"Charlie Lawrence","ModifiedBy":"Charlie Lawrence","LongDescription":"","Remarks":"","BookNowOverrideMessage":"","AccommodationNotes":"","NotesForWeb":"Annual Golf Day 2021","TCForWeb":"","ShortNotesForWeb":"","Committee":"","Responsibility":"","PromotionalCode":"","Region":"19053","SpeakerTutorOrganisation":"","ExpiryDays":"","CampaignAppeal":"","CostCentre":"","MainContact":"","Venue":"79240","EventStatus":"241","EventType":"227","LedgerAccount":"","VatRate":"19112","SpeakerTutor":"","StartTime":"08:00","EndTime":"16:00","WaitingListBy":"Session","CpdBy":"","SiteLayout":""}]}"
The API is returning a JSON string. Please try
$result = json_decode(curl_exec($curl));
$result is a php array.
Getting this reposes from the answer you provided.
How can I get the records only.
stdClass Object ( [Details] => stdClass Object ( [PageNo] => 1 [TotalRecords] => 21 [TotalPages] => 6 [MethodName] => GetEntity ) [Error] => stdClass Object ( [ErrorCode] => 200 [ErrorDescription] => Request Successfully Accommodated ) [Records] => Array ( [0] => stdClass Object ( [RecordId] => 79245 [Deleted] => N [CancellationWithNoRefund] => N [ShowOnWeb] => Y [BookNowOverrideOnWeb] => [WaitingListByEventOrSession] => [Active] => Y [Archive] => [DinnerType] => [StandardDay] => [EvacuationAssistanceRequired] => [IncludesMeals] => [FieldTrip] => [CpdAssignedToDelegate] => [Master] => [EventMaster] => [EnableApologies] => [MemberOnly] => N [AllowTableBooking] => [ExamDate] => [ExpiryDate] => [ArrivalDate] => [DepartDate] => [CutOffDate] => 2021-12-20 00:00:00.000 [BookingDeadline] => [StartDate] => 2021-12-21 00:00:00.000 [EndDate] => 2021-12-21 00:00:00.000 [DateDeleted] => [DateModified] => 20/07/2021 14:53:14 [DateCreated] => 20/07/2021 13:30:11 [NoOfDays] => 1 [AccreditionPoints] => [TotalTba] => 0 [MaximumSeats] => 64 [MinimumSeats] => 1 [TotalBookings] => 1 [TotalCancellations] => 0 [TotalRemoved] => [SeatsAvailable] => 63 [TotalOnWaitingList] => 0 [WaitingLimitPercentage] => 12.5 [WaitingLimitNumber] => 8 [EventCpdHours] => [MaximumAdditionalDelegates] => 4 [CommitteeName] => [SpeakerTutorOrganisationName] => [EventCode] => [ExpiryDaysName] => [ResponsibilityName] => [JoiningInstructions] => Further instructions will be emailed out [RegionName] => Southe [Location] => [PromotionalCodeName] => [EventUrl] => [CampaignAppealName] => [CostCentreName] => [InternalId] => [SpeakerTutorName] => [LedgerAccountName] => [MainContactName] => [VatRateName] => Standard 20% [EventTypeName] => Golf Day [EventStatusName] => Open [VenueName] => Foxhills Golf Club & Resort [RegistrationTime] => [DeletedBy] => [EventName] => Golf Day 2021 SL [FomalTitle] => Golf Day 2021 SL [SourceFile] => [EventId] => Golf Day SL [CreatedBy] => Sarah Lepak [ModifiedBy] => Sarah Lepak [LongDescription] => [Remarks] => [BookNowOverrideMessage] => [AccommodationNotes] => [NotesForWeb] => SL test golf day 2021 [TCForWeb] => T's & C's here [ShortNotesForWeb] => [Committee] => [Responsibility] => [PromotionalCode] => [Region] => 19053 [SpeakerTutorOrganisation] => [ExpiryDays] => [CampaignAppeal] => [CostCentre] => [MainContact] => [Venue] => 79240 [EventStatus] => 241 [EventType] => 227 [LedgerAccount] => [VatRate] => 19112 [SpeakerTutor] => [StartTime] => 10:30 [EndTime] => 16:00 [WaitingListBy] => Event [CpdBy] => [SiteLayout] => ) [1] => stdClass Object ( [RecordId] => 79244 [Deleted] => N [CancellationWithNoRefund] => N [ShowOnWeb] => Y [BookNowOverrideOnWeb] => [WaitingListByEventOrSession] => [Active] => Y [Archive] => [DinnerType] => [StandardDay] => [EvacuationAssistanceRequired] => [IncludesMeals] => [FieldTrip] => [CpdAssignedToDelegate] => [Master] => [EventMaster] => [EnableApologies] => [MemberOnly] => N [AllowTableBooking] => [ExamDate] => [ExpiryDate] => [ArrivalDate] => [DepartDate] => [CutOffDate] => 2021-09-20 00:00:00.000 [BookingDeadline] => [StartDate] => 2021-09-21 00:00:00.000 [EndDate] => 2021-09-21 00:00:00.000 [DateDeleted] => [DateModified] => 20/07/2021 13:30:03 [DateCreated] => 20/07/2021 13:30:01 [NoOfDays] => 1 [AccreditionPoints] => [TotalTba] => 0 [MaximumSeats] => 64 [MinimumSeats] => 1 [TotalBookings] => 0 [TotalCancellations] => 0 [TotalRemoved] => [SeatsAvailable] => 64 [TotalOnWaitingList] => 0 [WaitingLimitPercentage] => 78.13 [WaitingLimitNumber] => 50 [EventCpdHours] => [MaximumAdditionalDelegates] => 4 [CommitteeName] => [SpeakerTutorOrganisationName] => [EventCode] => [ExpiryDaysName] => [ResponsibilityName] => [JoiningInstructions] => [RegionName] => Southe [Location] => [PromotionalCodeName] => [EventUrl] => [CampaignAppealName] => [CostCentreName] => [InternalId] => [SpeakerTutorName] => [LedgerAccountName] => [MainContactName] => [VatRateName] => Standard 20% [EventTypeName] => Golf Day [EventStatusName] => Open [VenueName] => Foxhills Golf Club & Resort [RegistrationTime] => [DeletedBy] => [EventName] => CB Golf Experience 2021 [FomalTitle] => CB Golf Experience 2021 [SourceFile] => [EventId] => CBGE21 [CreatedBy] => Calvin Barnett [ModifiedBy] => Calvin Barnett [LongDescription] => [Remarks] => [BookNowOverrideMessage] => [AccommodationNotes] => [NotesForWeb] => Lorem ipsum Lorem ipsum [TCForWeb] => Cancellations more than 14 days ahead of the event will incur an administration fee of 10% per person deducted from their refund 28 days ahead or less - a 50% refund will be given 14 days ahead or less – no refunds will be given [ShortNotesForWeb] => [Committee] => [Responsibility] => [PromotionalCode] => [Region] => 19053 [SpeakerTutorOrganisation] => [ExpiryDays] => [CampaignAppeal] => [CostCentre] => [MainContact] => [Venue] => 79240 [EventStatus] => 241 [EventType] => 227 [LedgerAccount] => [VatRate] => 19112 [SpeakerTutor] => [StartTime] => 14:00 [EndTime] => 17:00 [WaitingListBy] => Event [CpdBy] => [SiteLayout] => ) [2] => stdClass Object ( [RecordId] => 79243 [Deleted] => N [CancellationWithNoRefund] => N [ShowOnWeb] => N [BookNowOverrideOnWeb] => [WaitingListByEventOrSession] => [Active] => Y [Archive] => [DinnerType] => [StandardDay] => [EvacuationAssistanceRequired] => [IncludesMeals] => [FieldTrip] => [CpdAssignedToDelegate] => [Master] => [EventMaster] => [EnableApologies] => [MemberOnly] => N [AllowTableBooking] => [ExamDate] => [ExpiryDate] => [ArrivalDate] => [DepartDate] => [CutOffDate] => [BookingDeadline] => [StartDate] => 2022-08-30 00:00:00.000 [EndDate] => 2022-08-30 00:00:00.000 [DateDeleted] => [DateModified] => 20/07/2021 14:48:13 [DateCreated] => 20/07/2021 13:29:59 [NoOfDays] => 1 [AccreditionPoints] => [TotalTba] => 0 [MaximumSeats] => 65 [MinimumSeats] => 1 [TotalBookings] => 1 [TotalCancellations] => 0 [TotalRemoved] => [SeatsAvailable] => 64 [TotalOnWaitingList] => 0 [WaitingLimitPercentage] => [WaitingLimitNumber] => [EventCpdHours] => [MaximumAdditionalDelegates] => 4 [CommitteeName] => [SpeakerTutorOrganisationName] => [EventCode] => [ExpiryDaysName] => [ResponsibilityName] => [JoiningInstructions] => [RegionName] => Eastmids [Location] => West lobby [PromotionalCodeName] => [EventUrl] => [CampaignAppealName] => [CostCentreName] => [InternalId] => [SpeakerTutorName] => [LedgerAccountName] => [MainContactName] => [VatRateName] => Standard 20% [EventTypeName] => Golf Day [EventStatusName] => Open [VenueName] => MilYork Test Venue [RegistrationTime] => [DeletedBy] => [EventName] => MY Golf Day 2022 [FomalTitle] => MY Golf Day 2022 [SourceFile] => [EventId] => MYGD22 [CreatedBy] => Dawn Hall [ModifiedBy] => Dawn Hall [LongDescription] => [Remarks] => [BookNowOverrideMessage] => [AccommodationNotes] => [NotesForWeb] => Park in West wing carpark [TCForWeb] => This is a CRM test. [ShortNotesForWeb] => [Committee] => [Responsibility] => [PromotionalCode] => [Region] => 19046 [SpeakerTutorOrganisation] => [ExpiryDays] => [CampaignAppeal] => [CostCentre] => [MainContact] => [Venue] => 77113 [EventStatus] => 241 [EventType] => 227 [LedgerAccount] => [VatRate] => 19112 [SpeakerTutor] => [StartTime] => 08:00 [EndTime] => 19:00 [WaitingListBy] => Session [CpdBy] => [SiteLayout] => ) [3] => stdClass Object ( [RecordId] => 79242 [Deleted] => N [CancellationWithNoRefund] => N [ShowOnWeb] => Y [BookNowOverrideOnWeb] => [WaitingListByEventOrSession] => [Active] => Y [Archive] => [DinnerType] => [StandardDay] => [EvacuationAssistanceRequired] => [IncludesMeals] => [FieldTrip] => [CpdAssignedToDelegate] => [Master] => [EventMaster] => [EnableApologies] => [MemberOnly] => N [AllowTableBooking] => [ExamDate] => [ExpiryDate] => [ArrivalDate] => [DepartDate] => [CutOffDate] => 2021-09-08 00:00:00.000 [BookingDeadline] => [StartDate] => 2021-09-08 00:00:00.000 [EndDate] => 2021-09-08 00:00:00.000 [DateDeleted] => [DateModified] => 20/07/2021 13:29:29 [DateCreated] => 20/07/2021 13:29:28 [NoOfDays] => 1 [AccreditionPoints] => [TotalTba] => 0 [MaximumSeats] => 64 [MinimumSeats] => 1 [TotalBookings] => 0 [TotalCancellations] => 0 [TotalRemoved] => [SeatsAvailable] => 64 [TotalOnWaitingList] => 0 [WaitingLimitPercentage] => 18.75 [WaitingLimitNumber] => 12 [EventCpdHours] => [MaximumAdditionalDelegates] => 4 [CommitteeName] => [SpeakerTutorOrganisationName] => [EventCode] => [ExpiryDaysName] => [ResponsibilityName] => [JoiningInstructions] => First come first serve basis [RegionName] => Southe [Location] => [PromotionalCodeName] => [EventUrl] => [CampaignAppealName] => [CostCentreName] => [InternalId] => [SpeakerTutorName] => [LedgerAccountName] => [MainContactName] => [VatRateName] => Standard 20% [EventTypeName] => Golf Day [EventStatusName] => Open [VenueName] => Foxhills Golf Club & Resort [RegistrationTime] => [DeletedBy] => [EventName] => Annual Golf Day 2021 - CL Version [FomalTitle] => Annual Golf Day 2021 - CL Version [SourceFile] => [EventId] => CL- GD21 [CreatedBy] => Charlie Lawrence [ModifiedBy] => Charlie Lawrence [LongDescription] => [Remarks] => [BookNowOverrideMessage] => [AccommodationNotes] => [NotesForWeb] => Annual Golf Day 2021 [TCForWeb] => [ShortNotesForWeb] => [Committee] => [Responsibility] => [PromotionalCode] => [Region] => 19053 [SpeakerTutorOrganisation] => [ExpiryDays] => [CampaignAppeal] => [CostCentre] => [MainContact] => [Venue] => 79240 [EventStatus] => 241 [EventType] => 227 [LedgerAccount] => [VatRate] => 19112 [SpeakerTutor] => [StartTime] => 08:00 [EndTime] => 16:00 [WaitingListBy] => Session [CpdBy] => [SiteLayout] => ) ) )

QuickBooks API ignoring TrackQtyOnHand field?

I am trying to add an inventory item using the QuickBooks PHP SDK. I specify TrackQtyOnHand, the starting inventory and inventory start date, but these fields appear to be ignored?
Any help would be greatly appreciated!
thanks!
Here is the request:
IPPItem Object
(
[Name] => Product Name
[Description] => ProductDesc
[Active] => 1
[SubItem] =>
[ParentRef] =>
[Level] =>
[FullyQualifiedName] =>
[Taxable] => 1
[SalesTaxIncluded] =>
[PercentBased] =>
[UnitPrice] => 17.54386
[RatePercent] =>
[Type] => Inventory
[PaymentMethodRef] =>
[UOMSetRef] =>
[IncomeAccountRef] => IPPReferenceType Object
(
[name] => Sales of Product Income
[type] => Account
[value] => 80
)
[PurchaseDesc] =>
[PurchaseTaxIncluded] =>
[PurchaseCost] => 4.24000
[ExpenseAccountRef] => IPPReferenceType Object
(
[name] => Cost of sales
[type] => Account
[value] => 81
)
[COGSAccountRef] =>
[AssetAccountRef] => IPPReferenceType Object
(
[name] => Inventory Asset
[type] => Account
[value] => 82
)
[PrefVendorRef] =>
[AvgCost] =>
[TrackQtyOnHand] => 1
[QtyOnHand] => 10
[QtyOnPurchaseOrder] =>
[QtyOnSalesOrder] =>
[ReorderPoint] =>
[ManPartNum] =>
[DepositToAccountRef] =>
[SalesTaxCodeRef] =>
[PurchaseTaxCodeRef] =>
[InvStartDate] => 2015-03-01
[BuildPoint] =>
[PrintGroupedItems] =>
[SpecialItem] =>
[SpecialItemType] =>
[ItemGroupDetail] =>
[ItemAssemblyDetail] =>
[ItemEx] =>
[Id] =>
[SyncToken] =>
[MetaData] =>
[CustomField] =>
[AttachableRef] =>
[domain] =>
[status] =>
[sparse] =>
)
And the response:
IPPItem Object
(
[Name] => Product Name
[Description] => ProductDesc
[Active] => true
[SubItem] =>
[ParentRef] =>
[Level] =>
[FullyQualifiedName] => Product Name
[Taxable] => false
[SalesTaxIncluded] => false
[PercentBased] =>
[UnitPrice] => 17.54386
[RatePercent] =>
[Type] => Service
[PaymentMethodRef] =>
[UOMSetRef] =>
[IncomeAccountRef] => 80
[PurchaseDesc] =>
[PurchaseTaxIncluded] => false
[PurchaseCost] => 4.24
[ExpenseAccountRef] => 81
[COGSAccountRef] =>
[AssetAccountRef] =>
[PrefVendorRef] =>
[AvgCost] =>
[TrackQtyOnHand] => false
[QtyOnHand] =>
[QtyOnPurchaseOrder] =>
[QtyOnSalesOrder] =>
[ReorderPoint] =>
[ManPartNum] =>
[DepositToAccountRef] =>
[SalesTaxCodeRef] =>
[PurchaseTaxCodeRef] =>
[InvStartDate] =>
[BuildPoint] =>
[PrintGroupedItems] =>
[SpecialItem] =>
[SpecialItemType] =>
[ItemGroupDetail] =>
[ItemAssemblyDetail] =>
[ItemEx] =>
[Id] => 15
[SyncToken] => 0
[MetaData] => IPPModificationMetaData Object
(
[CreatedByRef] =>
[CreateTime] => 2015-07-19T07:02:57-07:00
[LastModifiedByRef] =>
[LastUpdatedTime] => 2015-07-19T07:02:57-07:00
[LastChangedInQB] =>
[Synchronized] =>
)
[CustomField] =>
[AttachableRef] =>
[domain] =>
[status] =>
[sparse] =>
)
Did you enable Track Quantity on Hand in your company setting->Sales tab?

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;
}

Array comparion for multidimensinal array in php [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
recursive array_diff()?
Array 1 =>
pr($plan_data);
Array
(
[0] => Array
(
[AveragePrice] => 9.631161
[EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161456
[EarlyTerminationFee] => 150
[HurricaneRecovery] => 0.132
[MeterSurcharge] => 3.05
[OffCycle] => 5
[PUCAssessment] => 0.00167
[PlanDescription] => Savings Champ-6
[PlanId] => 57
[PlanIssueDate] => 12/10/2012
[PlanMonthlyFee] => 0
[PlanName] => PN1058
[PlanRate] => 9.3
[PlanRenewablePercent] => 7.2
[PlanTerm] => 6
[PriorityMoveIn] => 36
[ProviderDisplayName] => CenterPoint Energy
[ProviderId] => 21
[ProviderInternalName] => CNP_COAST
[RateId] => 161456
[RegularMoveIn] => 16
[TDSPPassThrough] => 0.03791
[TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161456
[YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
[provider] => ces
[ProductType] => Fixed
[Rep] => Champion Energy Services
[Zone] => 77479
)
[1] => Array
(
[AveragePrice] => 10.1311693
[EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161458
[EarlyTerminationFee] => 150
[HurricaneRecovery] => 0.132
[MeterSurcharge] => 3.05
[OffCycle] => 5
[PUCAssessment] => 0.00167
[PlanDescription] => Savings Champ-12
[PlanId] => 59
[PlanIssueDate] => 12/10/2012
[PlanMonthlyFee] => 0
[PlanName] => PN1060
[PlanRate] => 9.8
[PlanRenewablePercent] => 7.2
[PlanTerm] => 12
[PriorityMoveIn] => 36
[ProviderDisplayName] => CenterPoint Energy
[ProviderId] => 21
[ProviderInternalName] => CNP_COAST
[RateId] => 161458
[RegularMoveIn] => 16
[TDSPPassThrough] => 0.03791
[TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161458
[YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
[provider] => ces
[ProductType] => Fixed
[Rep] => Champion Energy Services
[Zone] => 77479
)
[2] => Array
(
[AveragePrice] => 10.4311743
[EFLUrl] => http://www.championenergyservices.com/register/EFL_API.asp?rateid=161459
[EarlyTerminationFee] => 150
[HurricaneRecovery] => 0.132
[MeterSurcharge] => 3.05
[OffCycle] => 5
[PUCAssessment] => 0.00167
[PlanDescription] => Green Power-12
[PlanId] => 60
[PlanIssueDate] => 12/10/2012
[PlanMonthlyFee] => 0
[PlanName] => PN1061
[PlanRate] => 10.1
[PlanRenewablePercent] => 100
[PlanTerm] => 12
[PriorityMoveIn] => 36
[ProviderDisplayName] => CenterPoint Energy
[ProviderId] => 21
[ProviderInternalName] => CNP_COAST
[RateId] => 161459
[RegularMoveIn] => 16
[TDSPPassThrough] => 0.03791
[TOCUrl] => http://www.championenergyservices.com/register/termsandconditions.asp?rateid=161459
[YRACUrl] => http://www.championenergyservices.com/register/\affiliatefiles\YRAC.PDF
[provider] => ces
[ProductType] => Fixed
[Rep] => Champion Energy Services
[Zone] => 77479
)
)
Array 2 =>
pr($temp_val);
Array
(
[0] => Array
(
[id] => 6
[PlanId] => 60
[PlanName] => Bounce 12 + A/C Protection
[PlanDescription] => Bounce 12 + A/C Protection - CNP
[PlanTerm] => 12
[PlanRate] =>
[RateId] =>
[PlanIssueDate] =>
[PlanMonthlyFee] =>
[EarlyTerminationFee] => 200.00000
[AveragePrice] => 12.00000
[HurricaneRecovery] =>
[PlanRenewablePercent] =>
[ProviderDisplayName] =>
[ProviderId] => 1
[provider] => bounce
[ProductZoneId] => 353
[Zone] => 77479
[ProviderInternalName] =>
[RegularMoveIn] =>
[PriorityMoveIn] =>
[OffCycle] =>
[TDSPPassThrough] =>
[PUCAssessment] =>
[EFLUrl] =>
[EFLLinkUrl] => http://www.bounceenergy.com/efls/bounce12.pdf
[TOCUrl] =>
[TOCLUrl] => http://www.bounceenergy.com/terms-of-service-fixed.pdf
[YRACUrl] =>
[YRACLUrl] => http://www.bounceenergy.com/yraac.pdf
[REP_Name] =>
[REP_PUCT] =>
[customer_service_email] =>
[toll_free_number] =>
[status] => active
[created] => 2012-12-14 12:40:05
[modified] => 2012-12-14
)
[1] => Array
(
[id] => 18
[PlanId] => 17
[PlanName] => Online Only - 12
[PlanDescription] => Online Only - 12
[PlanTerm] => 12
[PlanRate] =>
[RateId] => 386
[PlanIssueDate] =>
[PlanMonthlyFee] => 100.00000
[EarlyTerminationFee] => 175.00000
[AveragePrice] => 10.00000
[HurricaneRecovery] =>
[PlanRenewablePercent] =>
[ProviderDisplayName] =>
[ProviderId] => 2
[provider] => fulcrum
[ProductZoneId] =>
[Zone] => 77479
[ProviderInternalName] =>
[RegularMoveIn] =>
[PriorityMoveIn] =>
[OffCycle] =>
[TDSPPassThrough] =>
[PUCAssessment] =>
[EFLUrl] =>
[EFLLinkUrl] =>
[TOCUrl] =>
[TOCLUrl] =>
[YRACUrl] =>
[YRACLUrl] =>
[REP_Name] =>
[REP_PUCT] =>
[customer_service_email] =>
[toll_free_number] =>
[status] => active
[created] => 2012-12-14 12:40:15
[modified] => 2012-12-14
)
)
I want to compare this two array and if any key value is different i want to take it an different array..
$result_val= array_diff_assoc($plan_data, $temp_val);
Please help me out !!
Try something like this:
function array_diff_assoc($a, $b) {
$result = array();
foreach ($a as $k => $v) {
if ($b[$k] != $v) {
$result[$k] = [$v, $b[$k]];
}
}
return $result;
}

Magento accessing nested data

I have an object I'm trying to access data from but don't seem to be able to get to it.
Using Mage::log($request->debug());
I get the following output
Array
(
[all_items] => Array
(
[0 (Mage_Sales_Model_Quote_Item)] => Array
(
[item_id] => 593
[quote_id] => 536
[created_at] => 2012-07-12 11:40:17
[updated_at] => 2012-07-12 12:10:31
[product_id] => 37191
[store_id] => 8
[is_virtual] => 0
[sku] => 30018025
[name] => Fish Snowboard 2012
[free_shipping] =>
[is_qty_decimal] => 0
[no_discount] => 0
[weight] => 5000.0000
[qty] => 1
[price] => 429.12
[base_price] => 429.12
[discount_percent] => 0.0000
[discount_amount] => 0.0000
[base_discount_amount] => 0.0000
[tax_percent] => 20
[tax_amount] => 85.8200
[base_tax_amount] => 85.8200
[row_total] => 429.12
[base_row_total] => 429.12
[row_total_with_discount] => 0.0000
[row_weight] => 5000
[product_type] => simple
[price_incl_tax] => 514.94
[base_price_incl_tax] => 514.9400
[row_total_incl_tax] => 514.94
[base_row_total_incl_tax] => 514.94
[weee_tax_disposition] => 0
[weee_tax_row_disposition] => 0
[base_weee_tax_disposition] => 0
[base_weee_tax_row_disposition] => 0
[weee_tax_applied] => a:0:{}
[weee_tax_applied_amount] => 0
[weee_tax_applied_row_amount] => 0
[base_weee_tax_applied_amount] => 0
[qty_options] => Array
(
)
[product (OrganicInternet_SimpleConfigurableProducts_Catalog_Model_Product)] => Array
(
[entity_id] => 37191
[entity_type_id] => 4
[attribute_set_id] => 10
[type_id] => simple
[sku] => 30018025
[has_options] => 0
[required_options] => 0
[created_at] => 2011-06-19 17:34:46
[updated_at] => 2012-01-19 14:28:08
[name] => Fish Snowboard 2012
[small_image] => /f/i/fish-snowboard-2012-164.jpg
[thumbnail] => /f/i/fish-snowboard-2012-164.jpg
[url_key] => burton-fish-snowboard-2012-164cm
[url_path] => burton-fish-snowboard-2012-164cm
[msrp_enabled] => Use config
[msrp_display_actual_price_type] => Use config
[gift_message_available] =>
[status] => 1
[visibility] => 4
[enable_googlecheckout] => 1
[tax_class_id] => 2
[price] => 524.9400
[weight] => 5000.0000
[is_salable] => 1
[stock_item (Mage_CatalogInventory_Model_Stock_Item)] => Array
(
[item_id] => 35510
[product_id] => 37191
[stock_id] => 1
[qty] => 2.0000
[min_qty] => 0.0000
[use_config_min_qty] => 1
[is_qty_decimal] => 0
[backorders] => 0
[use_config_backorders] => 1
[min_sale_qty] => 1.0000
[use_config_min_sale_qty] => 1
[max_sale_qty] => 0.0000
[use_config_max_sale_qty] => 1
[is_in_stock] => 1
[notify_stock_qty] => 0.0000
[use_config_notify_stock_qty] => 1
[manage_stock] => 1
[use_config_manage_stock] => 1
[stock_status_changed_auto] => 0
[stock_status_changed_automatically] => 0
[use_config_qty_increments] => 1
[qty_increments] => 0.0000
[use_config_enable_qty_inc] => 1
[use_config_enable_qty_increments] => 1
[enable_qty_increments] => 0
[type_id] => simple
[stock_status] => 1
[product_name] => Fish Snowboard 2012
[store_id] => 8
[product_type_id] => simple
[product_status_changed] => 1
[ordered_items] => 1
)
[request_path] => burton-fish-snowboard-2012-164cm
[tier_price] => Array
(
)
[is_in_stock] => 1
[store_id] => 8
[customer_group_id] => 0
)
[tax_class_id] => 2
[has_error] =>
[is_nominal] =>
[base_original_price] => 514.9400
[taxable_amount] => 514.94
[base_taxable_amount] => 514.94
[is_price_incl_tax] => 1
[discount_calculation_price] => 429.12
[base_discount_calculation_price] => 429.12
[base_weee_tax_applied_row_amount] => 0
)
)
[dest_country_id] => GB
[dest_region_code] =>
[dest_street] => ndjn
[dest_city] => ihho
[dest_postcode] => iohih
[package_value] => 514.94
[package_value_with_discount] => 429.12
[package_weight] => 5000
[package_qty] => 1
[package_physical_value] => 429.12
[free_method_weight] => 5000
[store_id] => 8
[website_id] => 4
[free_shipping] => 0
[base_currency (Mage_Directory_Model_Currency)] => Array
(
[currency_code] => GBP
)
[package_currency (Mage_Directory_Model_Currency)] => Array
(
[currency_code] => GBP
)
[country_id] => GB
[region_id] => 0
[city] =>
[postcode] =>
[p_rcondition_name] => package_standard
[ignore_free_items] =>
)
I'd like to access $request[all_items][0][price] and $request[all_items][0][product][price]
I've tried a view different ways but no matter what I do I just don't seem to be able to get the bits I want out.
I'm sure its simple once you know how :P
You can try this :
$items = $request->getAllItems();
$itemPrice = $items[0]->getPrice();
$productPrice = $items[0]->getProduct()->getPrice();
You'll find some informations about Varien_Object here : http://alanstorm.com/magento_varien_object_debugging

Categories