Skip to main content

useOrderLineItem

This hook is used to get the order line item data. Used in orderDetail page .

ParamTypeDescriptionExample
titlestringtitle of the product" Red Shoe"
featureImgstringfeature image of the product"https://cdn.shopify.com/url/to/image.jpg"
variantTitlestringvariant title of the product"Red 42"
quantitynumberquantity of the product"2"
lineItemPricenumbertotal price of line item of a single product after discount with currency"Rs. 100"
singleProductPricenumberActual price of the single product with mrp discount"100"
singleRegularPricenumberRegular price of the single product without mrp discount"100"
singleProductPriceWithCurrencystringActual price with currency of the single product with mrp discount"Rs. 100"
singleRegularPriceWithCurrencystringRegular price with currency of the single product without mrp discount npm"Rs. 100"
singleProductPriceDiscountWithCurrencystringTotal discount with currency of the single product with mrp discount and other discounts."Rs. 100"
vendorstringvendor of the product"Nike"
orderIdstringorder id of the product"1234567890"
statusstringstatus of the product"Delivered"
openProductfunctionfunction to open productopenProduct()
orderobjectorder objectorder
lineItemobjectline item of the product objectlineItem
totalLineItemPriceWithCurrencystringtotal price of line item of a product after discount multiplied by quantity"Rs. 100"

Example

const OrderLineItem = (props) => {
const {
title,
featureImg,
variantTitle,
quantity,
lineItemPrice,
singleProductPrice,
singleRegularPrice,
singleProductPriceWithCurrency,
singleRegularPriceWithCurrency,
singleProductPriceDiscountWithCurrency,
vendor,
orderId,
status,
openProduct,
order,
lineItem,
} = useOrderLineItem(props);

return (
<View>
<Text>{title} </Text>
</View>
);
};
App Screenshot