Shopware6 - How to attach extra info to order line item?

Hi
In Shopware6 i want to attach or display some extra info to order line item in admin.
i am already storing this information in payload in database, but not sure how to display it.
i tried to override sw-order-line-items-grid but that didnt work.

import { Component } from ‘src/core/shopware’;
import templateOrder from './src/extension/sw-order-line-items-grid/sw-order-line-items-

Component.override(‘sw-order-line-items-grid’, {
    templateOrder
});

Any idea if is possible to override sw-order-line-items-grid ?
Or should i use some another approach ?

thanks

Hi Michal,

I guess this is connected to this topic: https://forum.shopware.com/discussion/63365/how-can-we-set-custom-fields-per-cart-line-item
For OrderLineItems it should be the same as for CartLineItems.

Kind regards,
Tim

hi timbrns

thanks

i have data already stored in payload

but not sure how to display them in admin when i click on order

as i probably need to override some template, but that wasnt working for me

Hi Michal,

might also consider to have a look into these topics:
https://docs.shopware.com/en/shopware-platform-dev-en/how-to/add-admin-new-column
https://docs.shopware.com/en/shopware-platform-dev-en/how-to/add-admin-new-field?category=shopware-platform-dev-en/how-to
It is not 100% for your case, but it should also work for your case aswell.

Kind regards,
Tim

use template instead of templateOrder