Documentation
Feedback
Guides

Order Placed

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.


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

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


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

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

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
{"base64":"  ","img":{"width":100,"height":100,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":3764,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-0.png"}}

op-confirmation-title

Renders the confirmation title.

Composition: none.

Props: none.

CSS Handles:

CSS HandleDescription
confirmationTitleConfirmation title h4 element
Default appearance
{"base64":"  ","img":{"width":512,"height":54,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":9378,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-1.png"}}

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
{"base64":"  ","img":{"width":1466,"height":96,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":34639,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-2.png"}}

op-print-button

Renders a button that triggers a full page print.

Composition: none.

Props: none.

CSS Handles:: none.

Default appearance
{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAI0lEQVR4nGO4df8ZA7csr6Tm87efGJ6//aSiZ6Nn4fb6/RcAnMgMq/Nyz7MAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-3.png","width":196,"height":80,"type":"png"}}

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
{"base64":"  ","img":{"width":1814,"height":776,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":120518,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-4.png"}}

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
{"base64":"  ","img":{"width":992,"height":299,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":28773,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-5.png"}}

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
{"base64":"  ","img":{"width":992,"height":536,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":59374,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-6.png"}}

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
{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABCAIAAAB2XpiaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAFUlEQVR4nGNYvmy5j4+PoaHh8ePHASQyBcExzCo6AAAAAElFTkSuQmCC","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-7.png","width":706,"height":84,"type":"png"}}

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
{"base64":"  ","img":{"width":444,"height":36,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":9013,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-8.png"}}

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
{"base64":"  ","img":{"width":400,"height":36,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":8063,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-9.png"}}

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
{"base64":"  ","img":{"width":1530,"height":116,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":26226,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-10.png"}}

op-order-customer

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

Composition: none.

Props: none.

CSS Handles: none.

Default appearance
{"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAALElEQVR4nGNgA4MJEya8e/eOQV5BQV5BQVxcfMKECQweHh5KSkri4uJhYWEAxj0J1zfd4IgAAAAASUVORK5CYII=","img":{"src":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-11.png","width":248,"height":208,"type":"png"}}

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
myAccountPathstringThe path to redirect a user to their profile page (rendered by the vtex.my-account app)./account

CSS Handles:

CSS HandlesDescription
orderOptionsWrapperWrapper of the option buttons
Default appearance
{"base64":"  ","img":{"width":1040,"height":80,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":16066,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-12.png"}}

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
{"base64":"  ","img":{"width":256,"height":180,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":14423,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-13.png"}}

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
{"base64":"  ","img":{"width":1984,"height":418,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":156490,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-14.png"}}

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
{"base64":"  ","img":{"width":1984,"height":668,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":127850,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-15.png"}}

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
{"base64":"  ","img":{"width":1190,"height":386,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":44528,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-order-placed-16.png"}}

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.


_10
import { useOrderGroup } from "vtex.order-placed/OrderGroupContext";
_10
_10
//...
_10
const orderGroup = useOrderGroup();

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


_10
import { useOrder } from "vtex.order-placed/OrderContext";
_10
_10
//...
_10
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
Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page