How to extends the Propel function according to the standard

harry
harry Posts: 9 🧑🏻‍🚀 - Cadet

Hi Everyone

I want to show the custom attribute in the order item corner that look like this one

My idea is i will add more column in the table

spy_sales_order_item_metadata

example column: additional_attributes

I see the function that adding data to the table spy_sales_order_item_metadata

\Spryker\Zed\SalesProductConnector\Persistence\Propel\Mapper\SalesOrderItemMetadataMapper::mapItemTransferToSalesOrderItemMetadataEntity

So how to extends this function to save more data to the column additional_attributes ?

Tagged:

Comments

  • vparannattilcherul
    vparannattilcherul Posts: 16 🧑🏻‍🚀 - Cadet

    You can extend this mapper class on your Pyz namespace by creating the same class in the Persistence Layer and then extend the factory in the Persistence Layer. Then rewrite the createSalesOrderItemMetadataMapper() method in that factory to instantiate the mapper of the Pyz version of the 'SalesOrderItemMetadataMapper' class.

  • harry
    harry Posts: 9 🧑🏻‍🚀 - Cadet

    Hi @vparannattilcherul

    Thanks your supporting

    I got your answer but is the above solution according Skyper's standard development ?

    I'm thinking should I create new table to manage the additional attributes ?