Posted on

Magento 2: Creating dynamic matrix in new/edit product page

I need to create a custom matrix for every product on Magento 2 product add/edit page. I need to have both the rows and columns to be dynamic so when someone click add button for either row or column there should be a row or column created depending upon his choice.

I tried to find solution for my problem but I don’t think Magento 2 supports anything like this however we can only add dynamic rows in Magento 2 but not Dynamic columns either.

So I decided to create a custom block on product page to use third-party extension for achieving my goal and then serializing the matrix data when the save button on product page is clicked and append it to form data somehow and get in my observer/plugin and process it according to my need.


I tried to add a custom block in Magento 2 product page by this article but I couldn’t see that it’s rendered on the page (may be some xml related stuff is updated in M2.2).

Is there really a way we can do so with Magento2? If no then please suggest me how can I add custom block on product page and how to link the matrix data with product form so when I submit it it can be captured on back-end.

Leave a Reply

Your email address will not be published.