Duplicating Product Fields to Ordered Items

❗️

This is now deprecated. Please see https://docs.auroracommerce.com/docs/submitting-ordered-item-fields for information on how to do this.

Product Fields are related internally to Products within Aurora. If you define an Aurora Product Field and wish to write the value of the field to the Ordered Item record at the time of the order you can submit the field names along with your checkout data.

Variation/Attribute Fields

If a product variation/attribute has the same field name as the product, it will override the field value saved to the Ordered Item additional field. This can be useful where you want a general field value at the product level, but you wish to override that value at the variation/attribute level.

Checkout

To submit the field names to copy to the order in a standard checkout flow, simply submit a hidden field in the form with the name duplicate_product_fields_to_ordered_items[] and the value being the clean field name for the product field. You can submit as many as you like.

<input name="duplicate_product_fields_to_ordered_items[]" type="hidden" value="my_field">

Non-Checkout Flows

When creating a checkout through the Ajax endpoint /checkout/setup-submit you can submit a data key duplicateProductFieldsToOrderedItems with an array of field names.

For example:

$.ajax({
  url: "/checkout/setup-submit?checkout_type=proxy-adyen",
  type: "POST",
  data: {
    // ... Other data
    duplicateProductFieldsToOrderedItems: ['my_field_1', 'my_field_2']
  },
});