Page 15 of 16 FirstFirst ... 513141516 LastLast
Results 141 to 150 of 159
  1. #141
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: How To Add New Product Fields?

    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

  2. #142
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: How To Add New Product Fields?

    Quote Originally Posted by lat9 View Post
    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.. that explains why I had to add some extra lines of code... I may have to play a bit to change my additional info fields too.
    Dave
    Always forward thinking... Lost my mind!

  3. #143
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    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:

    Code:
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . zen_draw_textarea_field('products_features', 'soft', '100%', '10', $pInfo->products_features, zen_set_field_length(TABLE_PRODUCTS, 'products_features')); ?></td>
    and update products (in the $sql_data_array):

    Code:
    'products_features' => zen_db_prepare_input($_POST['products_features'])
    How can I improve on this?
    Last edited by dharrison; 10 Oct 2019 at 08:41 AM. Reason: work in progress
    Debbie Harrison
    DVH Design | Web Design blog

  4. #144
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Hi @davewest

    Did you get any joy doing this. I opted to use Numinix product fields but even that has come with issues.
    Debbie Harrison
    DVH Design | Web Design blog

  5. #145
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: How To Add New Product Fields?

    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?

  6. #146
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    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 Harrison
    DVH Design | Web Design blog

  7. #147
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: How To Add New Product Fields?

    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:
    Code:
    if (class_exists('AdminRequestSanitizer') && method_exists('AdminRequestSanitizer', 'getInstance')) {
        $site_sanitizer = AdminRequestSanitizer::getInstance();
        $site_sanitizer->addSimpleSanitization('PRODUCT_DESC_REGEX', array('product_features'));
    }
    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').

  8. #148
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    Awesome I shall give that a try. Thanks Cindy. :)
    Debbie Harrison
    DVH Design | Web Design blog

  9. #149
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: How To Add New Product Fields?

    Quote Originally Posted by dharrison View Post
    Hi @davewest

    Did you get any joy doing this. I opted to use Numinix product fields but even that has come with issues.
    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.
    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");
    2) edit all three files and copy fields of products_description then paste rename to my new name (products_details)
    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..
    Code:
     <!-- bof product details -->
    <?php if ($products_details != '') { ?>
    <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_details); ?></div>
    <?php } ?>
     <!-- eof product details -->
    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..
    Dave
    Always forward thinking... Lost my mind!

  10. #150
    Join Date
    Mar 2009
    Location
    Essex, UK
    Posts
    446
    Plugin Contributions
    0

    Default Re: How To Add New Product Fields?

    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

    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>
    I know a language id needs to go in there somewhere, could anyone advise?
    Debbie Harrison
    DVH Design | Web Design blog

 

 
Page 15 of 16 FirstFirst ... 513141516 LastLast

Similar Threads

  1. How to add new fields?
    By chandroo007 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 1 Jun 2010, 03:13 PM
  2. How To Add New Fields to Invoice?
    By PudzPud in forum Basic Configuration
    Replies: 7
    Last Post: 15 Nov 2009, 03:50 PM
  3. Replies: 1
    Last Post: 10 Dec 2007, 02:40 PM
  4. How to add labels to new fields
    By kappaluppa in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 3 Feb 2007, 07:16 PM
  5. How i can add new data fields to a Product
    By shreesoft in forum Customization from the Admin
    Replies: 4
    Last Post: 2 Oct 2006, 03:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR