Want to remove/hide certain unnecesaary data fields?
Posted: Sun Mar 10, 2013 9:04 pm
There are times when some customers ask if it's possible to remove certain data fields they may not be using in their store, especially on the product pages. Rather than have them displayed and empty, it would be better (and less confusing) not to have them displayed at all.
In PrestaShop it's best not to completely remove a field from the core code, because PrestaShop and many addon modules make use of the ID feature of HTML tags to manipulate data or the GUI, and if you simply remove the field(s) you could 'break' the system.
A better way is to leave the fields in the code, but hide them so they're not displayed.
You can easily do this by editing the appropriate file and setting the style property of the HTML tag for the field in question to not display - i.e. style="display:none;".
This leaves the field and all associated code in place, but stops the field from being displayed on screen.
Note: Be careful when using this procedure for manadatory fields. Not displaying a field that requires mandatory data entry can cause issues, such as not being able to Save a record.
In PrestaShop it's best not to completely remove a field from the core code, because PrestaShop and many addon modules make use of the ID feature of HTML tags to manipulate data or the GUI, and if you simply remove the field(s) you could 'break' the system.
A better way is to leave the fields in the code, but hide them so they're not displayed.
You can easily do this by editing the appropriate file and setting the style property of the HTML tag for the field in question to not display - i.e. style="display:none;".
This leaves the field and all associated code in place, but stops the field from being displayed on screen.
Note: Be careful when using this procedure for manadatory fields. Not displaying a field that requires mandatory data entry can cause issues, such as not being able to Save a record.