Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Posts
    27
    Plugin Contributions
    0

    Default Short Description mod - bigger textbox for Product Add page?

    Hello all,

    I'm using jade's short description mod v1.1c (http://www.zen-cart.com/index.php?ma...cts_id=271)and the supplied pre-modded files installed perfectly.


    The only downside is that the short description textbox is a single line textarea (whereas the regular item description is a multiline, FCKEditor-enabled textbox).

    I'm not so bothered about the WYSIWYG functionality for the short description, but it would be really useful to have a multiline - just three or four lines max, with a 300/400 character limit on it.

    I've been sifting through the files to try and figure out how to modify this textbox, and the closest I can seem to get is in admin/info/modules/product/collect_info.php on line 401:

    PHP Code:
    <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES $languages[$i]['directory'] . '/images/' $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' zen_draw_input_field('products_short_desc[' $languages[$i]['id'] . ']',
     (isset(
    $products_short_desc[$languages[$i]['id']]) ? $products_short_desc[$languages[$i]['id']] : zen_get_products_short_desc($pInfo->products_id$languages[$i]['id'])),
     
    zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION'products_short_desc')); ?></td>
    (NB: this is all on one line in collect_info.php, I've just put a couple of line breaks in to make it more readable on the forum).


    I think it's the call to the zen_draw_input_field function and also there's something related with the zen_set_field_length call (is there a hard character limit in the database I wonder? I can't find any direct references searching the db for 'products_short_desc' so I'm guessing it's been defined as a PHP variable earlier on)



    Anyway, Zen Cart rapidly gets really quite complex if you try and dig through the PHP files and trace back exactly which piece of code actually generates something as simple (or so you'd think) as a textbox! I'm not a bleeding edge newbie, but this is my first major work with ZC, so if someone with a little experience with the short description mod - or just someone who knows their way around hacking the PHP a little better - I'd really appreciate some pointers.

    Cheers in advance,
    Christopher

  2. #2
    Join Date
    Apr 2005
    Posts
    298
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by christopherw View Post
    Hello all,

    I'm using jade's short description mod v1.1c (http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=271)and the supplied pre-modded files installed perfectly.


    The only downside is that the short description textbox is a single line textarea (whereas the regular item description is a multiline, FCKEditor-enabled textbox).

    I'm not so bothered about the WYSIWYG functionality for the short description, but it would be really useful to have a multiline - just three or four lines max, with a 300/400 character limit on it.

    I've been sifting through the files to try and figure out how to modify this textbox, and the closest I can seem to get is in admin/info/modules/product/collect_info.php on line 401:

    PHP Code:
    <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES $languages[$i]['directory'] . '/images/' $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' zen_draw_input_field('products_short_desc[' $languages[$i]['id'] . ']',
     (isset(
    $products_short_desc[$languages[$i]['id']]) ? $products_short_desc[$languages[$i]['id']] : zen_get_products_short_desc($pInfo->products_id$languages[$i]['id'])),
     
    zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION'products_short_desc')); ?></td>
    (NB: this is all on one line in collect_info.php, I've just put a couple of line breaks in to make it more readable on the forum).


    I think it's the call to the zen_draw_input_field function and also there's something related with the zen_set_field_length call (is there a hard character limit in the database I wonder? I can't find any direct references searching the db for 'products_short_desc' so I'm guessing it's been defined as a PHP variable earlier on)



    Anyway, Zen Cart rapidly gets really quite complex if you try and dig through the PHP files and trace back exactly which piece of code actually generates something as simple (or so you'd think) as a textbox! I'm not a bleeding edge newbie, but this is my first major work with ZC, so if someone with a little experience with the short description mod - or just someone who knows their way around hacking the PHP a little better - I'd really appreciate some pointers.

    Cheers in advance,
    Christopher
    If you are using the short description mod here is the code to add FCKeditor to it.

    In admin/includes/modules/product/collect_info.php page, find where the short description code is and change
    Code:
    <td class="main"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . zen_draw_input_field('products_short_desc[' . $languages[$i]['id'] . ']', (isset($products_short_desc[$languages[$i]['id']]) ? $products_short_desc[$languages[$i]['id']] : zen_get_products_short_desc($pInfo->products_id, $languages[$i]['id'])), zen_set_field_length(TABLE_PRODUCTS_DESCRIPTION, 'products_short_desc')); ?></td>
              </tr>
    To This
    Code:
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="main" width="25" valign="top">
                <td class="main"><?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 if ($_SESSION['html_editor_preference_status']=="FCKEDITOR") {
                    $oFCKeditor = new FCKeditor('products_short_desc[' . $languages[$i]['id'] . ']') ;
                    $oFCKeditor->Value = (isset($products_short_desc[$languages[$i]['id']])) ? stripslashes($products_short_desc[$languages[$i]['id']]) : zen_get_products_short_desc($pInfo->products_id, $languages[$i]['id']) ;
                    $oFCKeditor->Width  = '99%' ;
                    $oFCKeditor->Height = '350' ;
    //                $oFCKeditor->Config['ToolbarLocation'] = 'Out:xToolbar' ;
    //                $oFCKeditor->Create() ;
                    $output = $oFCKeditor->CreateHtml() ;  echo $output;
              } else { // using HTMLAREA or just raw "source"
    
              echo zen_draw_textarea_field('products_short_desc[' . $languages[$i]['id'] . ']', 'soft', '100%', '30', (isset($products_short_desc[$languages[$i]['id']])) ? stripslashes($products_short_desc[$languages[$i]['id']]) : zen_get_products_short_desc($pInfo->products_id, $languages[$i]['id'])); //,'id="'.'products_short_desc' . $languages[$i]['id'] . '"');
              } ?>
              </td>
              </tr>
                </table></td>
              </tr>
    and there you go hope this helps.
    [FONT=Comic Sans MS]Don Scott
    http://dealz-r-us.com
    [/FONT]

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Short Description mod - bigger textbox for Product Add page?

    I would suggest that it's unwise to use an HTML editor on a short-description field ... since you probably shouldn't be inserting HTML in your product listings ...
    .

    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.

  4. #4
    Join Date
    Apr 2005
    Posts
    298
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by DrByte View Post
    I would suggest that it's unwise to use an HTML editor on a short-description field ... since you probably shouldn't be inserting HTML in your product listings ...
    I don't understand why shouldn't you use html in your product listing? Not saying your wrong just trying to get an understanding.
    [FONT=Comic Sans MS]Don Scott
    http://dealz-r-us.com
    [/FONT]

  5. #5
    Join Date
    Jun 2007
    Posts
    27
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Don,

    Brilliant!!! I applied it, commenting out the old code, and bingo - it works perfectly.

    How the hell did you figure out which specific part of zen cart's massive array of PHP code needed updating? I tried to trace it through and logically work it out, but I failed dismally.

    Many, many thanks for your quick and simple fix! This complements the short description mod perfectly. Now all I have to do is clean up my awful template modifications ;)

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by dscott1966 View Post
    I don't understand why shouldn't you use html in your product listing? Not saying your wrong just trying to get an understanding.
    The "short description" should be "short". If you're using it to add HTML markup and all kinds of extra information, it kinda defeats the purpose of a "short" description, doesn't it?
    Or are you thinking of a product "listing" as more than just a "listing"? If so, why?
    .

    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.

  7. #7
    Join Date
    Apr 2005
    Posts
    298
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by DrByte View Post
    The "short description" should be "short". If you're using it to add HTML markup and all kinds of extra information, it kinda defeats the purpose of a "short" description, doesn't it?
    Or are you thinking of a product "listing" as more than just a "listing"? If so, why?
    Your right the, short description should be short no arguement there from me on that DrByte. I used it for a different purpose though. If you look here where it says features: http://www.usopenshop.org/product_p/usp8t28.htm

    This is what i used it for instead of putting it in the descriptions itself. I had this white space in the box to right of the image which to me looked kind of just blah and did not look right to me so when i seen that it just came to mind to do that.

    Here is my page you will see what i'm talking about: http://dealz-r-us.com/index.php?main...products_id=38

    Plus the question from the first post came up so i wanted to help also. I'm new to this php stuff and learning how to do different things so i took on the challenge to figure it out. And found that it was not hard to do. So i thank you for your in put DrByte and once again you are correct in your saying it suppose to be short i just took it a step further.
    [FONT=Comic Sans MS]Don Scott
    http://dealz-r-us.com
    [/FONT]

  8. #8
    Join Date
    Apr 2005
    Posts
    298
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by christopherw View Post
    Don,

    Brilliant!!! I applied it, commenting out the old code, and bingo - it works perfectly.

    How the hell did you figure out which specific part of zen cart's massive array of PHP code needed updating? I tried to trace it through and logically work it out, but I failed dismally.

    Many, many thanks for your quick and simple fix! This complements the short description mod perfectly. Now all I have to do is clean up my awful template modifications ;)
    christopherw,

    I just took a look at the collect info file and tried to rework it but like you it did not work. So after a lot of thought and looking at it. I came to the conclusion that it was the same code as the product description code. So all i had to do was use the same code and change all that had product_description to short_product_desc and that was all. plus just get it to line up correctly really easy. Glad it helped you.
    [FONT=Comic Sans MS]Don Scott
    http://dealz-r-us.com
    [/FONT]

  9. #9
    Join Date
    Jun 2007
    Posts
    27
    Plugin Contributions
    0

    Default Re: Short Description mod - bigger textbox for Product Add page?

    Quote Originally Posted by DrByte View Post
    The "short description" should be "short". If you're using it to add HTML markup and all kinds of extra information, it kinda defeats the purpose of a "short" description, doesn't it?
    Or are you thinking of a product "listing" as more than just a "listing"? If so, why?

    Indeed, I concur with Don here - I'm using the short descriptions for short summaries of each trip (zen cart is functioning in 'catalogue' mode without the ability to purchase anything in my case) - simple formatting such as italics or bold for key information, and line breaks, are what the wysiwyg editor come in useful for.

    Plus, having wysiwyg is so much simpler when the people who are going to be editing the catalogue in the future (i.e., not me!) don't have any HTML understanding. Presenting a word processor-like interface is far more of an adequate compromise :) And that's why I went for HTML in the short descriptions area.

  10. #10

    Default Re: Short Description mod - bigger textbox for Product Add page?

    I downloaded and installed this mod and it's working fine after some research here on the forums. The FCKeditor was easy to get added in.

    However the mod only allows you about 250 characters for input in the short part of the description. On my site that equals about 2 1/4 lines. I'd like to know how I could increase that. I'd like to have it be about one good small paragraph with the rest of our text at the bottom. Can anyone tell me where I'd make that change at?

 

 

Similar Threads

  1. Replies: 148
    Last Post: 18 Oct 2023, 12:08 PM
  2. v139h Short Description problems - no description on product list page
    By jgold723 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 24 Oct 2014, 05:52 AM
  3. v139h cannot copy product after installing Short Description mod
    By AndyCZ in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 26 May 2012, 09:41 AM
  4. Short Product Description for category page
    By hockey2112 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 Aug 2010, 11:35 PM
  5. Short Description for Cat. Mod: SQL error
    By RobertG in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 15 Feb 2010, 08:50 PM

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