When adding a new Product Attribute for a Product, how to make the "Is Required" checkbox defaults to Checked status?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
When adding a new Product Attribute for a Product, how to make the "Is Required" checkbox defaults to Checked status?
8 years ago
After add product attribute there is a option "Is Required" enable it.If you enable this then the first item of attribute value combination will be selected by default.
8 years ago
I mean in the admin how to set this "Is Required" checkbox defaults to checked so the admin user don't need to manually check it every time.
8 years ago
Then you need to change some code.
8 years ago
brad.wang wrote:
I mean in the admin how to set this "Is Required" checkbox defaults to checked so the admin user don't need to manually check it every time.


In the Administration\Views\Product\_CreateOrUpdate.ProductAttributes.cshtml view just add the following line

IsRequired: { editable: true, type: "boolean", defaultValue: true },

instead of

IsRequired: { editable: true, type: "boolean" },
8 years ago
It works, thanks a lot.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.