Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Posts
    12
    Plugin Contributions
    1

    Default Re: Is it possible to have a default value in text attributes?

    It doesn't appear that a default field for text attributes exist. I've made some code changes to my site to allow for this. It involves creating a new DB field, adding a "Default text" field, then the changes needed to read from the textarea and get it into the DB. It's not a difficult change, but it's not exactly trivial either.

    Maybe there's something in the contributions directory? I'd post my code, but it's not exactly "contribution" ready, and there appears to be no other forums available to do this sort of thing (i.e., posting of beta code, mods, etc.). If it's not a pressing need, I can share my mods with you offline.

  2. #2
    Join Date
    Sep 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: Is it possible to have a default value in text attributes?

    Hi Brianko,
    do you still have that piece of code?
    Thanks

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Is it possible to have a default value in text attributes?

    You would need something to then process the text to check for the question mark ...

    You could customize the functions_lookups.php and alter the code to meet the needs of no spaces can be used:
    PHP Code:
    // text required validation
        
    if (ereg('^txt_'$option)) {
          
    $check_attributes $db->Execute("select attributes_display_only, attributes_required from " TABLE_PRODUCTS_ATTRIBUTES " where products_id='" . (int)$product_id "' and options_id='" . (int)ereg_replace('txt_'''$option) . "' and options_values_id='0'");
    // text cannot be blank
          
    if ($check_attributes->fields['attributes_required'] == '1' and empty($value)) {
            
    $check_valid false;
          }
        } 
    Tidy up the $value in there before the test is done ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v139h Field doesn't have a default value
    By JoshS in forum General Questions
    Replies: 1
    Last Post: 13 Jul 2016, 04:29 PM
  2. 1364 Field 'query_keys_list' doesn't have a default value
    By geekgirl in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 13 Apr 2009, 12:54 AM
  3. BLOB/TEXT column 'products_options_values' can't have a default value ??
    By quantumfusion in forum Installing on a Windows Server
    Replies: 16
    Last Post: 26 Jan 2008, 01:40 AM
  4. 1101 BLOB/TEXT column can't have a default value
    By tkroh in forum Installing on a Windows Server
    Replies: 3
    Last Post: 27 Dec 2006, 10:28 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