How do I change the input box size in admin area? Let say for Products Name.
How do I change the input box size in admin area? Let say for Products Name.
Using Zen Cart 1.5.1
For built-in fields like Products Name, change the field length in the database, by editing the products table in phpMyAdmin.
You will then need to go change all other tables which store a product name, else those will lose the extra characters when data is saved to them.
Tread carefully. Make database backups before changing anything. Test in an offline copy of your site before changing things on your live store.
WARNING: long product names will also affect layout on your storefront. Be very sure about what you're doing before taking it live.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Dr. Byte - I do not want to change the actual Product Name character length. I want to change the box size in admin displaying the product name.
In fact, I have created 2 additional fields to the zen_Products table,
Field 1: varchar(32) utf8_general_ci Yes NULL
Field 2: varchar(96) utf8_general_ci Yes NULL
Even thought the in SQL table sizes are 32 and 96 for field 1 and 2, when in admin viewing the product detail, the input box displays 20 characters for both fields. I need to be able to expand the actual box size to view the entire text.
And as for the Product name field the box size shows only 45 characters, and you would not be able to see the entire 64 characters of the product name.
What area controls the display?
Using Zen Cart 1.5.1
Try line 138 of admin/includes/stylesheet.css
textarea {
width: 80%;
}
If you inspect the element of the products name entry box you see:
<input type="text" name="products_name[1]" value="You've Got Mail Linked" size="51" maxlength="64">
80% of 64(maxlength) gives you 51(size)
If it is generating HTML for those input fields that forces it to 20 chars length, then that means your Zen Cart is unable to read the field sizes from MySQL, thus the field sizes are being set to default.
This means your MySQL isn't supplying the metadata about the tables' fields correctly.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks