Я пытаюсь получить значения из json EstimatedDeliveryDate и amount, но я обнаружил ошибки и трудности, чтобы получить эти значения, я пробовал несколько способов, но ни одному не удалось извлечь результат, если у кого-то есть какие-либо советы по как я могу это сделать спасибо, следуйте приведенному ниже коду в javascript плюс json для извлечения
var json = {
"links": [
{
"rel": "self",
"href": "https://www.usereserva.com/ccstoreui/v1/shippingMethods"
}
],
"items": [
{
"shippingGroupId": "0",
"shippingAddress": {
"computedState": [
"RS"
],
"lastName": " asdas",
"country": "BR",
"numero": "",
"city": "Erechim",
"prefix": "",
"dynamicProperties": [
],
"postalCode": "99711268",
"jobTitle": "",
"companyName": "",
"county": "",
"predefinedAddressTypes": [
],
"isDefaultAddress": false,
"suffix": "",
"type": "",
"selectedCountry": "BR",
"computedCountry": [
"BR"
],
"selectedAddressTypes": [
],
"complemento": "",
"populateShippingMethods": true,
"alias": "",
"addressDescriptionComputed": "Rua Ernesto Pagnoncelli, Koller, Erechim - RS",
"state": "RS",
"isDefaultShippingAddress": false,
"email": "teste4@hotmail.com",
"selectedState": "RS",
"state_ISOCode": "BR-RS",
"isDefaultBillingAddress": false,
"types": [
],
"address3": "Koller",
"address2": "",
"address1": "Rua Ernesto Pagnoncelli",
"addressType": [
],
"defaultCountryCode": "BR",
"isTypeModified": false,
"firstName": "teste",
"phoneNumber": "(54) 984354020",
"computedDefaultShipping": false,
"computedDefaultBilling": false,
"repositoryId": "",
"recipient": "teste asdas",
"faxNumber": "",
"computedAddressType": [
],
"middleName": "",
"referencia": ""
},
"items": [
{
"commerceItemId": "ci17672126437481",
"quantity": 1,
"productId": "0053394",
"catRefId": "005339401402"
}
],
"shippingMethods": [
{
"shippingCalculator": "priceRange",
"eligibleForProductWithSurcharges": false,
"isExternallyPriced": false,
"ranges": [
{
"amount": 0.0,
"high": null,
"low": 0.0,
"repositoryId": "100001"
}
],
"associatedPriceListGroups": [
{
"repositoryId": "real"
}
],
"displayName": "Retire em Loja",
"description": "Retire em Loja",
"allSites": true,
"sites": [
],
"taxCode": null,
"type": 0,
"shippingGroupType": "hardgoodShippingGroup",
"enabled": true,
"displaySequence": 0,
"repositoryId": "100001",
"excludedCategoriesShippingCharge": [
],
"isFallback": false,
"id": "100001",
"shipToLocations": [
{
"repositoryId": "100001"
}
],
"excludedCategories": [
]
},
{
"shippingCalculator": "external",
"eligibleForProductWithSurcharges": false,
"estimatedDeliveryDateGuaranteed": false,
"internationalDutiesTaxesFees": "0",
"ranges": [
{
"amount": 19.87,
"high": 1.7976931348623157E308,
"low": 0
}
],
"displayName": "Transporte Padrão",
"taxCode": "GT987",
"shippingGroupType": "hardgoodShippingGroup",
"estimatedDeliveryDate": "2020-08-21T17:21:05Z",
"enabled": true,
"deliveryDays": 12,
"repositoryId": "Transporte Padrão",
"carrierId": "ON"
}
]
}
]
}
var deliveryDate = json["items"];
var deliveryPrice = json.items;
console.log(JSON.stringify(deliveryDate));
console.log(JSON.stringify(deliveryPrice));
// I NEED GET THAT JSON
//console.log(json.items[1].shippingMethods[2].estimatedDeliveryDate)
//console.log( json.items[1].shippingMethods[2].ranges[1].amount)