VTEX Developer Portal

Configuration

The order-placed app comes already installed on all stores and with it, it's possible to build your own page with the blocks exported by the app.

After defining a order-placed block inside your store/blocks directory or in your blocks.json file, the page can be constructed with blocks and customized with css handles.

Note: this is the default order-placed layout implementation.

// store/blocks/order-placed.jsonc
{
  "order-placed": {
    "blocks": ["op-header", "op-order"]
  },
  "op-header": {
    "children": [
      "op-section#confirmation",
      "op-section#notices",
      "op-summary-section",
      "op-bank-invoice-section"
    ]
  },
  "op-section#confirmation": {
    "props": {
      "name": "confirmation",
      "marginBottom": 9,
      "borderless": true
    },
    "children": [
      "op-confirmation-icon",
      "op-confirmation-title",
      "op-confirmation-message",
      "flex-layout.row#confirmation-buttons"
    ]
  },
  "flex-layout.row#confirmation-buttons": {
    "props": {
      "blockClass": "confirmationButtons",
      "marginTop": 8,
      "marginBottom": 8,
      "horizontalAlign": "center",
      "preventHorizontalStretch": true
    },
    "children": ["flex-layout.col#confirmation-buttons"]
  },
  "flex-layout.col#confirmation-buttons": {
    "children": ["op-print-button"]
  },
  "op-section#notices": {
    "props": {
      "name": "notices",
      "marginBottom": 9,
      "borderless": true
    },
    "children": ["op-notices"]
  },
  // each order section
  "op-order": {
    "children": [
      "flex-layout.row#order-header",
      "op-order-split-notice",
      "op-order-customer",
      "op-section#payments",
      "op-section#pickup-packages",
      "op-section#delivery-packages",
      "op-order-takeaway-packages",
      "op-order-total"
    ]
  },
  // each order header
  "flex-layout.row#order-header": {
    "props": {
      "fullWidth": true,
      "colSizing": "auto",
      "colGap": 5,
      "marginBottom": 5
    },
    "children": [
      "flex-layout.col#order-header-info",
      "flex-layout.col#order-header-options"
    ]
  },
  "flex-layout.col#order-header-info": {
    "children": ["op-order-number", "op-order-datetime", "op-order-seller"]
  },
  "flex-layout.col#order-header-options": {
    "children": ["responsive-layout.desktop#order-options-desktop"]
  },
  "responsive-layout.desktop#order-options-desktop": {
    "children": ["op-order-options"]
  },
  // payment section
  "op-section#payments": {
    "props": {
      "name": "paymentMethods"
    },
    "children": [
      "op-order-payment",
      "responsive-layout.mobile#order-options-mobile"
    ]
  },
  // bottom of top section of order header
  "responsive-layout.mobile#order-options-mobile": {
    "children": ["op-order-options#mobile"]
  },
  "op-order-options#mobile": {
    "props": {
      "blockClass": "mobile",
      "fullWidth": true
    }
  },
  "op-section#pickup-packages": {
    "props": {
      "name": "pickupPackages"
    },
    "children": ["op-order-pickup-packages"]
  },
  "op-section#delivery-packages": {
    "props": {
      "name": "deliveryPackages"
    },
    "children": ["op-order-delivery-packages"]
  }
}

Make sure you have the Order Placed page defined in your theme:

  "store.orderplaced": {
    "children": ["order-placed"]
  },

Blocks

order-placed

Main block, responsible for rendering the whole order placed page. It accepts the following blocks:

op-section

Splits your page into separate and semantic sections.

Composition:
Accepts an array of any kind of children blocks.

Props:

Prop nameTypeDescriptionDefault value
borderlessMaybeResponsiveInput<boolean> | booleanRemove the bottom border of the sectionfalse
marginBottomMaybeResponsiveInput<number> | numberMargin space below the section0
paddingBottomMaybeResponsiveInput<number> | numberPadding space below the section0
widthMaybeResponsiveInput<string> | stringWidth of the section100%
namestringName of the section. Use it to have custom css handles for it.undefined

CSS Handles:

CSS HandlesDescription
sectionAll section blocks
section--{name}Section named name

op-header

Defines the header content of the page.

Composition:
Accepts an array of any kind of children blocks.

Props: none.

CSS Handles:

CSS HandlesDescription
orderPlacedHeaderThe page header

op-footer

Defines the footer content of the page.

Composition:
Accepts an array of any kind of children blocks.

Props: none.

CSS Handles:

CSS HandlesDescription
orderPlacedFooterThe page footer

op-confirmation-icon

Renders the confirmation icon.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
confirmationIconWrapperIcon wrapper
Default appearance
op-confirmation-iconop-confirmation-icon

op-confirmation-title

Renders the confirmation title.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
confirmationTitleConfirmation title h4 element
Default appearance
op-confirmation-titleop-confirmation-title

op-confirmation-message

Renders the confirmation message, containing the clients email.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
confirmationMessageConfirmation message p element
Default appearance
op-confirmation-messageop-confirmation-message

op-print-button

Renders a button that triggers a full page print.

Composition: none.

Props: none.

CSS Handles:: none.

Default appearance
op-printop-print

op-notices

Renders a list of important informations relevant to the currently placed order. The messages may vary according to the type of order.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
noticesListList ul element
noticeListItemEach list li item element
Default appearance
op-noticesop-notices

op-summary-section

If a placed order is split between delivery and pickup, renders a summary of all pickup and delivery packages with informations such as number of items, packages, pickup/delivery address and pickup/delivery SLA.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
section--summarySummary whole section
summaryRowRow wrapper of both summary boxes
summaryColColumn wrapper of each summary box
summaryAddressWrapper of the pickup address
summaryBoxSurrounding box of the summary
summaryBox--deliverySurrounding box of the delivery summary
summaryBox--pickupSurrounding box of the pickup summary
summaryContentWrapper of the whole content of the box
summaryItemsWrapper of the number of items and packages
summaryShippingSLAWrapper of the shipping SLA information
summaryTitleBox h5 title element
Default appearance
op-summary-sectionop-summary-section

op-bank-invoice-section

Renders the bank invoice section if payment method chosen was bank invoice.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
section--bankInvoiceBank invoice whole section
barCodeWrapperWrapper of the barcode number and copy button
barCodeNumberBarcode number element
barCodeCopyButtonWrapperWrapper of the copy button
bankInvoiceEmbedWrapperWrapper of the bank invoice iframe
bankInvoiceEmbedBackgroundBackground of the bank invoice iframe
bankInvoiceEmbedEmbed of the bank invoice PDF
Default appearance
op-bank-invoice-sectionop-bank-invoice-section

op-order

Defines an order context to be able to render its meta information and packages. Must be used to display order data.

Composition:
Accepts an array of any kind of children blocks.

Props: none.

CSS Handles:

CSS HandleDescription
orderWrapperWrapper of an order meta information and packages

op-order-number

Renders the order id number. Must be placed inside an op-order block.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
orderNumberOrder number h3 element
Default appearance
op-order-numberop-order-number

op-order-datetime

Renders the date and time an order was placed. Must be placed inside an op-order block.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
orderDatetimeOrder date and time small element
Default appearance
op-order-datetimeop-order-datetime

op-order-seller

Renders the seller of an order. Must be placed inside an op-order block.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
orderSoldBySeller phrase small element
orderSellerSeller name span element
Default appearance
op-order-sellerop-order-seller

op-order-split-notice

Renders a message with the number of packages of an order if the order was split in more than one package. Must be placed inside an op-order block.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
splitNoticeWrapper of the message element
Default appearance
op-order-split-noticeop-order-split-notice

op-order-customer

Renders the customer information. Must be placed inside an op-order block.

Composition: none.

Props: none.

CSS Handles: none.

Default appearance
op-order-customerop-order-customer

op-order-options

Renders the customer information. Must be placed inside an op-order block.

Composition: none.

Props:

Prop nameTypeDescriptionDefault value
fullWidthbooleanMake the options wrapper take full horizontal spacefalse

CSS Handles:

CSS HandlesDescription
orderOptionsWrapperWrapper of the option buttons
Default appearance
op-order-optionsop-order-options

op-order-payment

Renders the customer information. Must be placed inside an op-order block.

Composition: none.

CSS Handles:

CSS HandlesDescription
orderPaymentWrapperWrapper of the payment methods list
orderPaymentItemWrapper of each payment method item
Default appearance
op-order-paymentop-order-payment

op-order-delivery-packages

Renders an order delivery packages information and product list. Must be placed inside an op-order block.

Composition: none.

CSS Handles:

CSS HandlesDescription
packageAll package sections
package--deliveryThe delivery package section
packageHeaderColumnColumn of header of a package section
packageHeaderHeader of a package section
packageHeader--deliveryHeader of the delivery package section
packageShippingEstimateDelivery estimate small element
packageAddressWrapperWrapper of the package shipping address
packageAddressTitleWrapper of the address title
packageDeliveryTitleWrapper of the delivery title
productListProduct list ul element
productListItemProduct list li item element
productWrapperWrapper of a single product
productImageColumnColumn of a product's image
productImageWrapperWrapper of a product's image
productInfoColumnColumn of a product's information
productNameProduct's a element
productMeasurementUnitProduct's measurement unit small element
productQuantityProduct's quantity small element
productPriceProduct's price
attachmentWrapperWrapper for a product's attachment
attachmentHeaderHeader of an attachment
attachmentTitleTitle of a attachment
attachmentToggleWrapperWrapper of the toggle button of an attachment
attachmentToggleButtonButton for toggling the attachment's accordion
attachmentToggleLabelAttachment's toggle label
attachmentContentAttachment's content wrapper
attachmentContentItemEach attachment's content paragraph
Default appearance
op-order-delivery-packagesop-order-delivery-packages

op-order-pickup-packages

Renders an order pickup packages information and product list. Must be placed inside an op-order block.

Composition: none.

CSS Handles:

Note: Include the same CSS handles as op-order-delivery-packages

CSS HandlesDescription
packageAll package sections
package--pickupThe pickup package section
packageInfoWrapperWrapper of a pickup package's information
packageReceiverPackage's pickup receiver information container
packageReceiverNameName of the package's pickup receiver
packageAdditionalInfoWrapper of additional information about a pickup package
Default appearance
op-order-pickup-packagesop-order-pickup-packages

op-order-total

Renders an order delivery packages information and product list. Must be placed inside an op-order block.

Composition: none.

CSS Handles:

CSS HandlesDescription
totalListWrapperWrapper of the total price list of an order
totalListAn order's total list ul element
totalListItemAn order's total item li element
totalListItemLabelLabel of a price item
totalListItemValueValue of a price item
Default appearance
op-order-totalop-order-total

API

The order-placed app exports two hooks to allow customization using the current order data: useOrderGroup and useOrder.

useOrderGroup: used to get the data of the current order group. An order group is the collection of all orders created by an users's purchase.

import { useOrderGroup } from 'vtex.order-placed/OrderGroupContext'

//...
const orderGroup = useOrderGroup()

useOrder: used to get the data of the current order being accessed in the order loop.

import { useOrder } from 'vtex.order-placed/OrderContext'

//...
const order = useOrder()

Customization

In order to apply CSS customizations in this and other blocks, follow the instructions given in the recipe on Using CSS Handles for store customization.

CSS Handles
attachmentContent
attachmentContentItem
attachmentHeader
attachmentTitle
attachmentToggleButton
attachmentToggleLabel
attachmentToggleWrapper
attachmentWrapper
bankInvoiceEmbed
bankInvoiceEmbedBackground
bankInvoiceEmbedWrapper
barCodeCopyButtonWrapper
barCodeContainer
barCodeNumber
barCodeWrapper
confirmationIconWrapper
confirmationMessage
confirmationTitle
errorMessage
errorTitle
errorWrapper
noticeListItem
noticesList
orderDatetime
orderList
orderListItem
orderNumber
orderOptionsWrapper
orderPaymentItem
orderPaymentWrapper
orderPlacedFooter
orderPlacedHeader
orderPlacedMainWrapper
orderPlacedWrapper
orderSeller
orderSoldBy
orderWrapper
package--delivery
package--pickup
package
packageAdditionalInfo
packageAddressWrapper
packageGiftDescription
packageHeader--delivery
packageHeader--pickup
packageHeader
packageHeaderColumn
packageInfoWrapper
packageReceiver
packageReceiverName
packageShippingEstimate
packageSLA
printButtonWrapper
printHintWrapper
productImageColumn
productImageWrapper
productInfoColumn
productName
productListItem
productList
productMeasurementUnit
productPrice
productQuantity
productWrapper
section--bank-invoice
section--confirmation
section--deliveryPackages
section--notices
section--paymentMethod
section--pickupPackages
section--summary
section
splitNotice
summaryRow
summaryCol
summaryAddress
summaryBox--delivery
summaryBox--pickup
summaryBox
summaryContent
summaryItems
summaryShipping
summaryTitle
totalList
totalListItem
totalListItemLabel
totalListItemValue
totalListWrapper

Contributing

Check it out how to contribute with this project.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Updated 22 days ago


Order Placed


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.