vtex-apps / minicart

VTEX Minicart app
10 stars 52 forks source link

Adaptar para suportar assembly options #69

Closed jgfidelis closed 5 years ago

jgfidelis commented 5 years ago

Está sendo implementado no checkout a opção de ter assembly options, itens que compõe um item.

O minicart deverá ser adaptado para mostrar apenas os itens "pai" e mostrar seus filhos de uma segunda maneira, e não cada item de maneira separada

Exemplo de output de um orderForm novo (ver campo items):

teste ===== addItem:  { orderFormId: '8a33d2f535c0454486579fd191e238ac',
  salesChannel: '1',
  loggedIn: false,
  isCheckedIn: false,
  storeId: null,
  checkedInPickupPointId: null,
  allowManualPrice: false,
  canEditData: true,
  userProfileId: null,
  userType: null,
  ignoreProfileData: false,
  value: 2980,
  messages: [],
  items:
   [ { uniqueId: 'E942B8D66B734168A1E2A88CCFE2D118',
       id: '17',
       productId: '13',
       refId: '1111',
       ean: null,
       name: 'Pepperoni Small',
       skuName: 'Small',
       modalType: null,
       parentItemIndex: null,
       parentAssemblyBinding: null,
       assemblies: [],
       priceValidUntil: '2019-12-20T19:25:51.988066Z',
       tax: 0,
       priceDefinitions: null,
       price: 1490,
       listPrice: 1490,
       manualPrice: null,
       sellingPrice: 1490,
       orderRewardStatus: 'invoiced',
       rewardValue: 0,
       isGift: false,
       additionalInfo: [Object],
       preSaleDate: null,
       productCategoryIds: '/4/',
       productCategories: [Object],
       quantity: 1,
       seller: '1',
       sellerChain: [Array],
       imageUrl: 'http://delivery.vteximg.com.br/arquivos/ids/155439-55-55/pepperoni-feast.0e1c4c9e7b8900d08cc51ff285fd9ae3.1.jpg?v=636770441237070000',
       detailUrl: '/pizza-pepperoni/p',
       components: [],
       bundleItems: [],
       attachments: [],
       attachmentOfferings: [],
       offerings: [],
       priceTags: [],
       availability: 'available',
       measurementUnit: 'un',
       unitMultiplier: 1 },
     { uniqueId: '77B3FA20D0AC416090BA66C7FBDE17BC',
       id: '14',
       productId: '12',
       refId: '14',
       ean: null,
       name: 'Classic Crust',
       skuName: 'Classic Crust',
       modalType: null,
       parentItemIndex: 0,
       parentAssemblyBinding: 'Pepperoni - Small_Crust',
       assemblies: [],
       priceValidUntil: '2019-12-20T19:25:51.988066Z',
       tax: 0,
       priceDefinitions: null,
       price: 1490,
       listPrice: 1490,
       manualPrice: null,
       sellingPrice: 1490,
       orderRewardStatus: 'invoiced',
       rewardValue: 0,
       isGift: false,
       additionalInfo: [Object],
       preSaleDate: null,
       productCategoryIds: '/4/7/',
       productCategories: [Object],
       quantity: 1,
       seller: '1',
       sellerChain: [Array],
       imageUrl: 'http://delivery.vteximg.com.br/arquivos/ids/155413-55-55/classic.png?v=636759866429100000',
       detailUrl: '/classic-crust/p',
       components: [],
       bundleItems: [],
       attachments: [],
       attachmentOfferings: [],
       offerings: [],
       priceTags: [],
       availability: 'available',
       measurementUnit: 'un',
       unitMultiplier: 1 },
     { uniqueId: 'A7F203636A0D47D29233183BFC9A6126',
       id: '9',
       productId: '7',
       refId: '3',
       ean: null,
       name: 'Pepperoni',
       skuName: 'Pepperoni',
       modalType: null,
       parentItemIndex: 0,
       parentAssemblyBinding: 'Pepperoni - Small_Basic Toppings',
       assemblies: [],
       priceValidUntil: '2019-12-20T19:25:51.988066Z',
       tax: 0,
       priceDefinitions: null,
       price: 0,
       listPrice: 0,
       manualPrice: null,
       sellingPrice: 0,
       orderRewardStatus: 'invoiced',
       rewardValue: 0,
       isGift: false,
       additionalInfo: [Object],
       preSaleDate: null,
       productCategoryIds: '/4/6/',
       productCategories: [Object],
       quantity: 1,
       seller: '1',
       sellerChain: [Array],
       imageUrl: 'http://delivery.vteximg.com.br/arquivos/ids/155428-55-55/Topping_Pepperoni.jpg.png?v=636766047561270000',
       detailUrl: '/pepperoni/p',
       components: [],
       bundleItems: [],
       attachments: [],
       attachmentOfferings: [],
       offerings: [],
       priceTags: [],
       availability: 'available',
       measurementUnit: 'un',
       unitMultiplier: 1 } ],
  selectableGifts: [],
  totalizers:
   [ { id: 'Items', name: 'Items Total', value: 2980 },
     { id: 'Shipping', name: 'Shipping Total', value: 0 } ],
  shippingData:
   { address:
      { addressType: 'residential',
        receiverName: '',
        addressId: '8b84ab52b5ac4582bfc954070e4019e8',
        postalCode: '22250-040',
        city: 'Rio de Janeiro',
        state: 'RJ',
        country: 'BRA',
        street: 'Praia de Botafogo',
        number: '300',
        neighborhood: 'Botafogo',
        complement: '',
        reference: null,
        geoCoordinates: [Array] },
     logisticsInfo: [ [Object], [Object], [Object] ],
     selectedAddresses: [ [Object] ],
     availableAddresses: [ [Object] ],
     pickupPoints: [ [Object], [Object], [Object] ] },
  clientProfileData: null,
  paymentData:
   { installmentOptions: [ [Object], [Object], [Object], [Object], [Object] ],
     paymentSystems: [ [Object], [Object], [Object], [Object], [Object] ],
     payments: [],
     giftCards: [],
     giftCardMessages: [],
     availableAccounts: [],
     availableTokens: [] },
  marketingData: null,
  sellers: [ { id: '1', name: 'VTEX', logo: '' } ],
  clientPreferencesData: { locale: 'en-US', optinNewsLetter: null },
  commercialConditionData: null,
  storePreferencesData:
   { countryCode: 'BRA',
     saveUserData: true,
     timeZone: 'E. South America Standard Time',
     currencyCode: 'BRL',
     currencyLocale: 1046,
     currencySymbol: 'R$',
     currencyFormatInfo:
      { currencyDecimalDigits: 2,
        currencyDecimalSeparator: ',',
        currencyGroupSeparator: '.',
        currencyGroupSize: 3,
        startsWithCurrencySymbol: true } },
  giftRegistryData: null,
  openTextField: null,
  invoiceData: null,
  customData: null,
  itemMetadata:
   { items:
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ] },
  hooksData: null,
  ratesAndBenefitsData: { rateAndBenefitsIdentifiers: [], teaser: [] },
  subscriptionData: null,
  itemsOrdination: null }
screen shot 2018-12-20 at 17 25 57
regis-samurai commented 3 years ago

Algo sobre isso? @jgfidelis