Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Number of characters of Short Descriptions addon

    In the Short Descriptions mod here:

    http://www.zen-cart.com/index.php?ma...roducts_id=271

    the SQL patch instructs to add the following lines to the database:


    -----
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Display Product Short Descriptions', 'PRODUCT_LIST_SHORT_DESC', '3', 'Set to 0 to disable, set to 1-99 to enable.', 8, 11, now(), now(), NULL, NULL);

    ALTER TABLE products_description ADD products_short_desc VARCHAR( 255 ) DEFAULT NULL AFTER products_description;
    ALTER TABLE categories_description ADD categories_description_sub TEXT NOT NULL;

    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Product Info - Display Product Short Descriptions', 'PRODUCT_INFO_SHORT_DESC', '1', 'Show Product''s short Description<br />0= off<br />1= on', 18, 30, now(), now(), NULL, 'zen_cfg_select_drop_down(array(array(''id''=>''0'', ''text''=>''Off''), array(''id''=>''1'', ''text''=>''On'')),');
    ----



    So now my questions is, how can I change the number of characters from 255 to for example 30000? I guess I need to reload the line:


    ---
    ALTER TABLE products_description ADD products_short_desc VARCHAR( 255 ) DEFAULT NULL AFTER products_description;
    ALTER TABLE categories_description ADD categories_description_sub TEXT NOT NULL;
    ---


    but can I simply change it to:


    ---
    ALTER TABLE products_description ADD products_short_desc VARCHAR( 30000 ) DEFAULT NULL AFTER products_description;
    ALTER TABLE categories_description ADD categories_description_sub TEXT NOT NULL;
    ---


    and submit it via Admin -> Tools -> Install SQL Patches ?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Number of characters of Short Descriptions

    Um, last time I checked, "30,000" characters was NOT a "short description".


    If you insist it is, you'll have to change VARCHAR(255) to TEXT
    .

    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.

  3. #3
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Number of characters of Short Descriptions

    Hehe yes you are probably right, 30000 characters is not a short text.

    I changed:

    ALTER TABLE products_description ADD products_short_desc VARCHAR( 255 ) DEFAULT NULL AFTER products_description;

    to


    ALTER TABLE products_description ADD products_short_desc TEXT DEFAULT NULL AFTER products_description;

    and used the SQL Query Executor to send it to the database, but got the error:

    ERROR: Cannot ADD column products_short_desc because it already exists


    Is there a way to replace or update the current statement without deleting the existing characters I already have in the database (I already have a lot of less than 255 character descriptions that I would like to avoid deleting)?
    Could I use the REPLACE or UPDATE statement?

    My SQL knowledge is pretty bad so any help is much appreciated.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Number of characters of Short Descriptions

    change ADD to CHANGE COLUMN and repeat the column name.

    Or, within phpMyAdmin just edit the table structure and change the column type directly.
    .

    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.

  5. #5
    Join Date
    Oct 2007
    Posts
    328
    Plugin Contributions
    0

    Default Re: Number of characters of Short Descriptions

    Thanks a lot! I changed the values in phpMyAdmin and now all of my 30000 character "short" description shows up.

 

 

Similar Threads

  1. Double byte problems, characters being cut short
    By Reesy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 15 May 2010, 06:34 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