Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    41
    Plugin Contributions
    0

    Default Default description

    hey guys,

    been searching around the forum but unfortunately, i havnt found what i need.

    all i need is to add a default text/content on my categories description. so when i add a new category the content is already there which i will just have to edit.

    so anyone can tell me where the page to edit? and how?


    any help is much appreciated..


    thanks.

  2. #2
    Join Date
    Feb 2010
    Posts
    154
    Plugin Contributions
    0

    Default Re: Default description

    bhadz08,

    There isn't a way to do this with zencart admin, but you can do it if you want to edit one of the core files - namely includes/functions_lookups.php

    First of all, make a copy of functions_lookups.php which is located in your /includes folder.

    Edit the file and look for the zen_get_category_name() function, which is on about line 271.

    Best thing to do is rename the existing function to zen_get_category_name_orig(), then paste in this new one....

    PHP Code:
    /*
     * Find category name from ID, in indicated language
     */
      
    function zen_get_category_name($category_id$fn_language_id) {
        global 
    $db;
        
    $category_query "select categories_name
                           from " 
    TABLE_CATEGORIES_DESCRIPTION "
                           where categories_id = '" 
    $category_id "'
                           and language_id = '" 
    $fn_language_id "'";

        
    $category $db->Execute($category_query);

        
    // modified code - adds default text to category descriptions...
        
    $defaultText "Put the default text here that you want to appear in your category description.";
        
    $returnDescription = empty($category->fields['categories_name']) ? $defaultText $category->fields['categories_name'];

        return 
    $returnDescription;
      } 
    I've added three lines of code in there which checks to see if the returned category description is blank. If it is, then it replaces it with the default text that you specify.

    Be aware that this is a core file, so when you upgrade zencart it will get overwritten and you'll have to add the code in there again.

  3. #3
    Join Date
    Jun 2009
    Posts
    41
    Plugin Contributions
    0

    Default Re: Default description

    thanks a lot.. it works!

 

 

Similar Threads

  1. v153 Product Page Description and Details Blank By Default?
    By Yourvirtualworld in forum Basic Configuration
    Replies: 7
    Last Post: 7 Jan 2015, 01:24 AM
  2. How to set a default description for 'new products'?
    By Raze in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 24 Feb 2009, 12:10 AM
  3. Default Product Description...
    By Alex Clarke in forum General Questions
    Replies: 4
    Last Post: 21 Jan 2007, 09:15 PM
  4. Default content in description
    By spottedhaggis in forum General Questions
    Replies: 0
    Last Post: 11 Sep 2006, 08:37 PM

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