Debbie and Dave, that's a result of the zc155a+ admin sanitizer, er, sanitizing those additional text fields. See this Zen Cart documentation for more information: https://docs.zen-cart.com/Developer_...n_sanitization
Debbie and Dave, that's a result of the zc155a+ admin sanitizer, er, sanitizing those additional text fields. See this Zen Cart documentation for more information: https://docs.zen-cart.com/Developer_...n_sanitization
Thanks lat9 and Dave
That does make sense but it is a bit teccie for my head.
Dave the new code for my product fields in collect_info are as follows:
and update products (in the $sql_data_array):Code:<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_textarea_field('products_features', 'soft', '100%', '10', $pInfo->products_features, zen_set_field_length(TABLE_PRODUCTS, 'products_features')); ?></td>
How can I improve on this?Code:'products_features' => zen_db_prepare_input($_POST['products_features'])
Last edited by dharrison; 10 Oct 2019 at 08:41 AM. Reason: work in progress
Hi @davewest
Did you get any joy doing this. I opted to use Numinix product fields but even that has come with issues.
Debbie, could you give a couple of examples of the information you expect to be entered in those "products_features"? Specifically, is this HTML content?
Hi lat9
Absolutely. I achieved similar on this website https://shaftdirect.com/the-manual-s...efc2b9f874d24a
Here all the tabs (except for gallery and finishes) show extra information about the products..
I'd love to achieve the same for this website - the only difference in this case is we also have Dutch and French translations.
I hope this helps.
Debbie, you can tell the admin sanitizer to leave the HTML content in that 'product_features' variable alone by creating a new .php file in the site's /admin/includes/extra_datafiles sub-directory, containing:
Just use a unique name for the $site_sanitizer variable and, if you have other HTML-type content that should be 'left alone', just add those variables' names to that array, e.g. array('product_features', 'another_variable', 'yet_another_variable').Code:if (class_exists('AdminRequestSanitizer') && method_exists('AdminRequestSanitizer', 'getInstance')) { $site_sanitizer = AdminRequestSanitizer::getInstance(); $site_sanitizer->addSimpleSanitization('PRODUCT_DESC_REGEX', array('product_features')); }
Awesome I shall give that a try. Thanks Cindy. :)
Yes... I had to read back through this post, but I use a different method. Instead of a separate table, I use a function to maintain template table add-ons..
I use a field for more info, when it has something in it, it displays, empty it does not display.
The best way to do this type of edits is to copy another field that matches what you are after. in this case, products_description works for my more details.
Steps I did..
1) add the field to products description table.. by adding it to my install function, I have some 20 fields I use.
2) edit all three files and copy fields of products_description then paste rename to my new name (products_details)Code:if (!$sniffer->field_exists(TABLE_PRODUCTS_DESCRIPTION,'products_details')) $db->Execute("ALTER TABLE " . TABLE_PRODUCTS_DESCRIPTION . " ADD COLUMN products_details TEXT NULL DEFAULT NULL");
Files: collect_info.php preview_info.php update_product.php all three if not already, should be in the product type folder.
3) follow the sanitizer suggestion from Cindy.. Which works really grate.. Thanks Cindy for pointing that out..
4 ) on the catalog side. add the new database field to the page main_template_vars.php Again, look for any of the products_description fields, copy, paste and rename products_details
5) add the display code to the template page.. this is how I did it..
Hopefully this helps a bit.. the main thing to take away is that the correct code is already in existing files, all you need do is copy and paste, rename the field and add to the database. In keeping it short what sounds simple may not be.. Hopefully in the future this well become easier with CITTINS..Code:<!-- bof product details --> <?php if ($products_details != '') { ?> <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_details); ?></div> <?php } ?> <!-- eof product details -->
Dave
Always forward thinking... Lost my mind!
it works!!! Thank you both so much.
I only have one remaining issue: How do I set the language on the add/edit product screen? I have had a play but so far got nowhere.
In admin/includes/modules/product/collect_info.php I use
I know a language id needs to go in there somewhere, could anyone advise?Code:<tr> <td class="main" valign="top">Features (tab)</td> <td class="main"><?php echo zen_draw_textarea_field('products_features', 'soft', '100%', '10', $pInfo->products_features, zen_set_field_length(TABLE_PRODUCTS, 'products_features')); ?></td> </tr>
Bookmarks