Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Adding default text in the collect_info.php file

    Ok, I'm not a programmer but I've been able to modify the collect_info.php file to display default info in some fields. On my attached picture, you can see I've modified the products_quantity and products_price fields and these work great. But on the products_description field I cannot get this text to display... I've played around with quotes within the quotes and some other feeble attempts but this is beyond my ability. I'd really appreciate some help.... thx in advance.
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2014
    Location
    Ontario, Canada
    Posts
    252
    Plugin Contributions
    3

    Default Re: Adding default text in the collect_info.php file

    Quote Originally Posted by mrcastle View Post
    Ok, I'm not a programmer but I've been able to modify the collect_info.php file to display default info in some fields. On my attached picture, you can see I've modified the products_quantity and products_price fields and these work great. But on the products_description field I cannot get this text to display... I've played around with quotes within the quotes and some other feeble attempts but this is beyond my ability. I'd really appreciate some help.... thx in advance.
    I'm not certain I understand what you are modifying.

    If you'd like to change the default text for your product fields go to admin/includes/languages/english/product.php

    If you'd like to add admin 'notes' to your product page go to: admin/includes/modules/product/collect_info.php

    Add in the code in red to reflect the changes you desire.
    Code:
              <tr>
                <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
                <td colspan="2"><table border="0" cellspacing="0" cellpadding="0"><span class="errorText">*Leave default product description here.</span>
                  <tr>
    Hope that helps,

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Adding default text in the collect_info.php file

    I thought the intent was thatwhen adding a new product, that the description of the product would come with some initial text to which other information may be added... This way the additional text would not need to be added on each entry.

    Otherwise there are other tools that could be used to rapidly add additional product such as EasyPopulate v4 or Apsona.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Adding default text in the collect_info.php file

    Thanks for the quick response. In a nutshell, when I am entering new inventory I would like to have some standard text already in the product description box. I have had success with quantity "1" and price "3.95" as shown in my pic. I thought I could modify the description field to default that information "new-old stock remains in new condition" but no matter what I do, it will not place that info in the box. If it is the other file you mentioned (products.php) could you give me an idea where that might be entered ? Thx!

  5. #5
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Adding default text in the collect_info.php file

    Ok thanks.... you are right, easy populate is the easiest solution.

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Adding default text in the collect_info.php file

    Quote Originally Posted by mrcastle View Post
    Ok, I'm not a programmer but I've been able to modify the collect_info.php file to display default info in some fields. On my attached picture, you can see I've modified the products_quantity and products_price fields and these work great. But on the products_description field I cannot get this text to display... I've played around with quotes within the quotes and some other feeble attempts but this is beyond my ability. I'd really appreciate some help.... thx in advance.
    You're on the right track, but it is the default zencart code that is preventing it from working the way you expect.

    I've had a play with the code and the solution isn't too difficult.

    Find this code (in the collect_info.php file)
    Code:
     
              <tr>
                <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
                <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
                    <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars((isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']), ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td>
                   </tr>
                </table></td>
              </tr>
    Replace it with this:
    Code:
     
              <tr>
                <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
                <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
                     <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars((isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : (zen_get_products_description($pInfo->products_id, $languages[$i]['id'])) ? :$pInfo->products_description , ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td>
                  </tr>
                  </table></td>
              </tr>
    Although this probably looks a bit of a mess, there is only the one line of code that needs changing. It's a very long line though.

    Cheers
    RodG
    Last edited by RodG; 9 Apr 2015 at 09:56 PM.

  7. #7
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Adding default text in the collect_info.php file

    Hey Rod, I tried this but had no luck.... just a blank screen upon entering new product. I'll try and figure it out but if something pop's up at you, please let me know. I really appreciate the effort... would love to get this feature working.

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Adding default text in the collect_info.php file

    Quote Originally Posted by mrcastle View Post
    Hey Rod, I tried this but had no luck.... just a blank screen upon entering new product.
    A blank screen usually results is something being written to the log files.

    Also, do you also get the blank screen when trying to edit an existing product?

    Quote Originally Posted by mrcastle View Post
    I'll try and figure it out but if something pop's up at you, please let me know. I really appreciate the effort... would love to get this feature working.
    Perhaps if you post a copy of the modified line from your code (and a few lines before it) I may spot something that got changed with the cut n pastings. I hope/assume you did a copy/paste rather than trying to retype the code?

    Cheers
    RodG

  9. #9
    Join Date
    Feb 2010
    Posts
    205
    Plugin Contributions
    0

    Default Re: Adding default text in the collect_info.php file

    Hey Rod, just tried it one more time to make sure it wasn't user error. Actually I don't get a blank screen.... I still get the menu at the top and then nothing below it. Here are a few lines before and after, which includes your revision. Thanks! Mitch

    <script language="javascript"><!--
    updateGross();
    //--></script>
    <?php
    for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
    ?>
    <tr>
    <td class="main" valign="top"><?php if ($i == 0) echo

    TEXT_PRODUCTS_DESCRIPTION; ?></td>
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <tr>
    <td class="main" valign="top"><?php if ($i == 0) echo

    TEXT_PRODUCTS_DESCRIPTION; ?></td>
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td class="main" width="25" valign="top"><?php echo zen_image

    (DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages

    [$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
    <td class="main" width="100%"><?php echo zen_draw_textarea_field

    ('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30',

    htmlspecialchars((isset($products_description[$languages[$i]['id']])) ?

    stripslashes($products_description[$languages[$i]['id']]) :

    (zen_get_products_description($pInfo->products_id, $languages[$i]['id'])) ? :

    $pInfo->products_description , ENT_COMPAT, CHARSET, TRUE));

    //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td>
    </tr>
    </table></td>
    </tr>

    <?php
    }
    ?>
    <tr>
    <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1',

    '10'); ?></td>
    </tr>
    <tr>
    <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24',

    '15') . '&nbsp;' . zen_draw_input_field('products_quantity', $pInfo-

    >products_quantity); ?></td>
    </tr>
    <tr>
    <td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1',

    '10'); ?></td>
    </tr>
    <tr>
    <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
    <td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24',

    '15') . '&nbsp;' . zen_draw_input_field('products_model', htmlspecialchars

    (stripslashes($pInfo->products_model), ENT_COMPAT, CHARSET, TRUE),

    zen_set_field_length(TABLE_PRODUCTS, 'products_model')); ?></td>
    </tr>
    <tr>

  10. #10
    Join Date
    Jan 2014
    Location
    Ontario, Canada
    Posts
    252
    Plugin Contributions
    3

    Default Re: Adding default text in the collect_info.php file

    Quote Originally Posted by RodG View Post
    Replace it with this:
    Code:
     
              <tr>
                <td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
                <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;</td>
                     <td class="main" width="100%"><?php echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', htmlspecialchars((isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : (zen_get_products_description($pInfo->products_id, $languages[$i]['id'])) ? :$pInfo->products_description , ENT_COMPAT, CHARSET, TRUE)); //,'id="'.'products_description' . $languages[$i]['id'] . '"'); ?></td>
                  </tr>
                  </table></td>
              </tr>
    Although this probably looks a bit of a mess, there is only the one line of code that needs changing. It's a very long line though.

    Cheers
    RodG
    I add the new text change ? :$pInfo->products_description
    Nothing changed in my admin. New product page looks unchanged.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 collect_info.php
    By tenerifetom in forum Upgrading to 1.5.x
    Replies: 14
    Last Post: 5 Jan 2013, 06:52 PM
  2. collect_info.php (copy of product_music\collect_info.php) dynamic dropdownlist
    By SPsen in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 1 Feb 2010, 10:05 PM
  3. Can't replace the default text in shopping_cart.php
    By noelsaw in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 10 Sep 2009, 05:37 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