Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2012
    Posts
    481
    Plugin Contributions
    0

    Default Boolean Configuration Key Values

    I've added a custom configuration item and find the configuration_value is a string. Is there a way to set up the value as a boolean? I used the following as set_function:
    Code:
    zen_cfg_select_option(array('true', 'false'),
    I know I can use the configuration_value as a string in the code, but for my case, a lot of editing would be saved if I could force the value to boolean.
    Thank you.
    Dave

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,878
    Plugin Contributions
    96

    Default Re: Boolean Configuration Key Values

    A couple of possibilities:

    1. Zen Cart 2.1.0 will include a new function that returns a boolean value for that string version. See this GitHub commit: https://github.com/zencart/zencart/c...56de5dfda1daae

    2. What I've done in much of my code for a 'true' or 'false' configuration value is something akin to
    PHP Code:
    $config_val_is_true = (CONFIG_VALUE === 'true'); 

 

 

Similar Threads

  1. 1062 Duplicate entry '1-1' for key 1 in Options Values Manager
    By willbarraclough in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 28 Sep 2010, 10:53 PM
  2. Extra Configures file will not load configuration key values
    By mrmeech in forum Contribution-Writing Guidelines
    Replies: 6
    Last Post: 7 Apr 2008, 04:58 AM
  3. Lost My Configuration Key
    By heavenlylingerie in forum General Questions
    Replies: 1
    Last Post: 15 Nov 2006, 11:26 AM

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