Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Custom Configuration Setting Tutorial?

    Is there anywhere that gives a tutorial on the steps required to make a some simple configuration settings to be added to the configuration menu? I believe it is a case of writing an SQL patch to set it up but have no clue how to format it?

    What I am after is a simple on/off setting to be either added to an existing configuration menu or to be located in a new custom configuration menu.

    If there are any guides or if anyone can show me how to do this id be grateful.

    Cheers
    Phil
    Phil Rogers
    A problem shared is a problem solved.

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Custom Configuration Setting Tutorial?


  3. #3
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Custom Configuration Setting Tutorial?

    Hey stevesh,

    no I think that is describing how to disply new admin pages. what im after is how to create a patch to add a configuration menu item.

    so for example if i wanted to have an extran menu item in maximum values, with the option 0 or 1 or on of off?
    Phil Rogers
    A problem shared is a problem solved.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,889
    Plugin Contributions
    96

    Default Re: Custom Configuration Setting Tutorial?

    First, you'll note that when you view Configuration->Maximum Values that it shows a URL like:
    Code:
    http://www.example.com/myadmin/configuration.php?gID=3
    So 3 is the configuration_group_id value and you'll create a SQL script similar to the following which you can copy/paste into Tools->Install SQL Patches:
    Code:
    INSERT INTO configuration ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function)
    VALUES ( "The title of my new value", "A_UNIQUE_KEY_TO_IDENTIFY_THE_VALUE", "No", "A description of what the value is and what it controls.", 3, 40, NOW(), NULL, "zen_cfg_select_option(array('Yes', 'No'),");

  5. #5
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Custom Configuration Setting Tutorial?

    Ok so breaking it down the following gets inserted. A few questions.

    configuration_title - "The title of my new value" - happy with this
    configuration_key - A_UNIQUE_KEY_TO_IDENTIFY_THE_VALUE - what woud the unique key be what format?
    configuration_value - No - what is this used for?
    configuration_description - A description of what the value is and what it controls. - happy with this
    configuration_group_id - 3 - happy with what this refers to
    sort_order - 40 - happy with this
    date_added - NOW() - happy with this
    use_function - NULL - what is this used for?
    set_function - zen_cfg_select_option(array('Yes', 'No') - assume this sets a yes no option and could be set to what ever values I want?

    Cheers

    Phil
    Phil Rogers
    A problem shared is a problem solved.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,889
    Plugin Contributions
    96

    Default Re: Custom Configuration Setting Tutorial?

    Quote Originally Posted by philip937 View Post
    Ok so breaking it down the following gets inserted. A few questions.

    configuration_title - "The title of my new value" - happy with this
    configuration_key - A_UNIQUE_KEY_TO_IDENTIFY_THE_VALUE - what woud the unique key be what format?
    configuration_value - No - what is this used for?
    configuration_description - A description of what the value is and what it controls. - happy with this
    configuration_group_id - 3 - happy with what this refers to
    sort_order - 40 - happy with this
    date_added - NOW() - happy with this
    use_function - NULL - what is this used for?
    set_function - zen_cfg_select_option(array('Yes', 'No') - assume this sets a yes no option and could be set to what ever values I want?

    Cheers

    Phil
    Phil, the "unique key" is simply a capitalized, underscore-separated "name" that you'll use to reference the value in your code. If you're placing the value into the Maximum Values group, I'd name the key something MAXIMUM_VALUE_WHATEVER, where WHATEVER describes the value's usage. When you've creating a value with a radio-button (e.g. Yes/No), the use_function has no meaning so its value is set to NULL.

 

 

Similar Threads

  1. Question after following the Custom Sidebox Tutorial in the wiki
    By bobmeetin in forum Templates, Stylesheets, Page Layout
    Replies: 16
    Last Post: 29 Apr 2013, 02:32 PM
  2. Custom shipping module instructions/tutorial/template/framework
    By Dave.T in forum Addon Shipping Modules
    Replies: 1
    Last Post: 30 Nov 2010, 04:27 AM
  3. UK Configuration Tutorial
    By SWUK in forum General Questions
    Replies: 2
    Last Post: 7 Apr 2009, 09:44 AM
  4. Seriously Weird Configuration Setting In Zen Cart?
    By GE3K in forum General Questions
    Replies: 9
    Last Post: 23 Mar 2008, 11:20 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