---
title: "Custom line item properties"
slug: "custom-line-item-properties"
date: "2022-12-11T15:39:17+00:00"
modified: "2025-11-07T21:40:39+00:00"
author: "admin"
canonical: "https://preproduct.io/docs/custom-line-item-properties/"
---

> PreProduct can add extra Shopify line item properties to your cart and resulting orders. This works for both mixed and isolated [redirects](https://preproduct.io/docs/front-end-redirects/).

#### Adding custom line item properties to pre-orders

To add custom properties, set the `ppCustomLineItemProperties` variable on the window object. This must be a JavaScript object. Here’s how:

```javascript
window.ppCustomLineItemProperties = {
  "preorders_are": `great`
}
```

#### Adding line item properties from customer input

Sometimes Shopify product pages have form fields for the customer to fill in which are submitted as line item properties. Below is a snippet that you can copy and paste into your theme’s product page to include these on pre-orders.

```markup

<script>
	window.addEventListener('ppCartSessionTransactionReady', (e) => {
		const inputs = document.querySelectorAll('input[name*="properties"]');

		inputs.forEach((input) => {
			const name = input.name.replace("properties[", "").replace("]", "")
			e.detail.itemAddition.properties[name] = input.value;
		});
	});
</script>
```
