Add product variants to the list of products

Iman Emran asked on November 22, 2017 14:37

Hello,

For better and faster access to products and their related variants for changing prices and stocks, we need a way to view products and variants in a same table or unigrid.

So is it possible to show and edit products and related variants list in one place like the Products application? Can I change the Products application unigrid to achieve this purpose?

How can I do that?

thanks

Recent Answers


Trevor Fayas answered on November 23, 2017 03:01

This is definitely possible, but you'll need to do some coding to do it.

First step is to create a custom UI that will contain your UniGrid.

Then Actually add the UniGrid control, you'll want to use a custom query of sorts to populate the unigrid how you want it to go.

Next step is (by default) a unigrid only shows data, not editing. So you need to extend the Unigrid (see this article) , specefically using the OnExternalDataBound so you can control what is returned for the various fields.

The trick is to overwrite the OnExternalDataBound, catch the field you want to make a textbox, and return an actual Textbox control with an ID that you should be able to recognize (like "tbx_SKUPRICE")

This will give you textboxs on your Unigrid that you can fill out.

Next you want to add a Submit button or save button, and on save loop through your Unigrid control's rows, and search for your textbox controls, and perform the logic you wish to do with the values in them.

It's a bit complex, i've done it before, but this is about how you would do it.

0 votesVote for this answer Mark as a Correct answer

Iman Emran answered on November 23, 2017 21:12

Hi Trevor Fayas,

Thanks a lot for your reply.

I have a question, the Products application shows a list of product document in a Unigrid so how can I add product variants to this Unigrid?

Can you help me to do that in action?

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on November 24, 2017 05:28

You may be able to try to extend the Unigrid on that UI and adjust it's data source...but i'de have to do a lot of experimenting to do that, and in the end this may not even be enough. You may need to add your own UI element (which you can do), then you can indeed create your own unigrid to have whatever you want in it.

You may want to contact a Kentico partner if you don't have .Net coder resources available, this one is totally doable, but it is not simple and will require a software engineer i would say : /

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.