Results 1 to 5 of 5
  1. #1

    Default how to register new module I'm writing for 1.5?

    Hi,
    I have written a module for Zen Cart 1.5 but am struggling to get the configuration appearing under Admin->Configuration.

    In my SQL I have this code:
    Code:
    SET @cid=0;
    SELECT (@cid:=configuration_group_id) as cid 
    FROM configuration_group
    WHERE configuration_group_title= 'Dynamic Filter';
    DELETE FROM configuration WHERE configuration_group_id = @cid;
    DELETE FROM configuration_group WHERE configuration_group_id = @cid;
    INSERT INTO configuration_group VALUES (NULL, 'Dynamic Filter', 'Dynamic Filter Settings', '1', '1');
    SET @cid=last_insert_id();
    UPDATE configuration_group SET sort_order = @cid WHERE configuration_group_id = @cid;
    INSERT INTO configuration VALUES (NULL, 'Enable on Category Pages', 'FILTER_CATEGORY', 'Yes', 'Enable the filter on category pages?', @cid, '10', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Enable on All Products Page', 'FILTER_ALL', 'Yes', 'Enable the filter on all products page?', @cid, '20', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Enable on New Products Page', 'FILTER_NEW', 'Yes', 'Enable the filter on new products page?', @cid, '30', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Enable on Featured Products Page', 'FILTER_FEATURED', 'Yes', 'Enable the filter on featured products page?', @cid, '40', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Enable on Specials Page', 'FILTER_SPECIALS', 'Yes', 'Enable the filter on specials page?', @cid, '50', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Enable on Search Page', 'FILTER_SEARCH', 'Yes', 'Enable the filter on advanced search page?', @cid, '60', now(), now(), NULL, "zen_cfg_select_option(array('Yes', 'No'),"),
                                     (NULL, 'Filter Style', 'FILTER_STYLE', 'Link', 'How are the filters to be applied?<br /><br /><strong>Link</strong> - Each option is a link; Only one filter can be applied at a time.<br /><strong>Dropdown 
    
    (Single)</strong> - Each option is part of a drop down list; Only one filter can be applied at a time.<br /><strong>Dropdown (Multi)</strong> - Each option is part of a drop down list; Multiple filters can be applied at a time.<br 
    
    /><strong>Checkbox (Single)</strong> - Each option is a checkbox; Only one filter can be applied at a time.<br /><strong>Checkbox (Multi)</strong> - Each option is a checkbox; Multiple filters can be applied at a time.', @cid, '70', now
    
    (), now(), NULL, "zen_cfg_select_option(array('Link', 'Dropdown - Single', 'Dropdown - Multi', 'Checkbox - Single', 'Checkbox - Multi'),"),
                                     (NULL, 'Disabled Options Method', 'FILTER_METHOD', 'Greyed', 'How are the unavailable filter options to be disabled?<br /><br /><strong>Greyed</strong> - Grey out the unavailable options.<br 
    
    /><strong>Hidden</strong> - Hide the unavailable options.', @cid, '80', now(), now(), NULL, "zen_cfg_select_option(array('Greyed', 'Hidden'),"),
                                     (NULL, 'Options Box Style', 'FILTER_OPTIONS_STYLE', 'Scroll', 'Which style of box should be used when the maximum number of options has been reached?<br /><br /><strong>Scroll</strong> - Scroll box.<br 
    
    /><strong>Expand</strong> - Expanding box with More/Less link.<br /><br /><strong>Note: This option is only applicatble with Link or Checkbox filter styles.</strong>', @cid, '90', now(), now(), NULL, "zen_cfg_select_option(array
    
    ('Scroll', 'Expand'),"),
                                     (NULL, 'Maximum Number of Options', 'FILTER_MAX_OPTIONS', '9', 'What is the maximum number of options to be displayed before scroll bar/More link is visible?<br /><br /><strong>Note: This option is only 
    
    applicatble with Link or Checkbox filter styles.</strong>', @cid, '100', now(), now(), NULL, NULL),
                                     (NULL, 'Maximum Number of Price Ranges', 'FILTER_MAX_RANGES', '5', 'What is the maximum number of price range groups?<br /><br /><strong>Note: This can be overridden by the Maximum Price Range 
    
    parameter</strong>', @cid, '110', now(), now(), NULL, NULL),
                                     (NULL, 'Minimum Price Range', 'FILTER_MIN_PRICE', '10', 'What is the minimum gap in the price ranges?<br />Set as zero to deactivate.', @cid, '120', now(), now(), NULL, NULL),
                                     (NULL, 'Maximum Price Range', 'FILTER_MAX_PRICE', '25', 'What is the minimum gap in the price ranges?<br />Set as zero to deactivate.', @cid, '130', now(), now(), NULL, NULL),
                                     (NULL, 'Include Options', 'FILTER_OPTIONS_INCLUDE', '', 'Enter the list of option IDs to be included in the filter, separated by commas (i.e. 1,2,3)<br />Only the option numbers listed here will appear in 
    
    the filter.<br />Leave blank to deactivate.', @cid, '140', now(), now(), NULL, NULL),
                                     (NULL, 'Exclude Options', 'FILTER_OPTIONS_EXCLUDE', '', 'Enter the list of option IDs to be excluded from the filter, separated by commas (i.e. 1,2,3)<br />The option numbers listed here will 
    
    <strong>not</strong> appear in the filter.<br />Leave blank to deactivate.', @cid, '150', now(), now(), NULL, NULL),
                                     (NULL, 'Google Event Tracking', 'FILTER_GOOGLE_TRACKING', 'No', 'Use Google Event Tracking?<br /><br /><strong>No</strong> - Do not use Google Event Tracking<br /><strong>ga.js</strong> - Use traditional 
    
    ga.js Google Event Tracking method<br /><strong>Asynchronous</strong> - Use new asynchronous Google Event Tracking method<br /><br /><strong>Note: Requires Google Analytics Code</strong>', @cid, '160', now(), now(), NULL, 
    
    "zen_cfg_select_option(array('No', 'ga.js', 'Asynchronous'),");
    
    
    /*
    zencart 1.5 mods
    */
    DELETE FROM admin_pages WHERE page_key='dynamicFilterConfig';
    INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order) VALUES ('dynamicFilterConfig','BOX_CONFIGURATION_DYNAMIC_FILTER','FILENAME_CONFIGURATION',CONCAT('gID=',LAST_INSERT_ID()), 'configuration', 'Y', LAST_INSERT_ID());
    The SQL runs ok (and works in versions prior to 1.5) but when I go to Admin->Configuration in 1.5, there is no configuration for my module.
    Can you tell me what I'm doing wrong?
    I can't find much help on this; what I've cobbled together is from another 1.5 module in the downloads section.

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

    Default Re: how to register new module in 1.5 ?

    Did you go in and grant yourself access to it after you registered the page?
    Admin Access Management
    .

    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

    Default Re: how to register new module I'm writing for 1.5?

    Hi Dr B,
    I'm not sure how I grant myself access from that menu.
    If I go Admin Profiles and Add a New Profile, I get all the checkboxes but my new one isn't listed.

    My user is listed as 'Superuser' at the moment. Is it possible to access the 'checkbox screen' for that profile?

  4. #4

    Default Re: how to register new module I'm writing for 1.5?

    Got it!
    I forgot to upload this to the admin extra_data_files
    Code:
    define('BOX_CONFIGURATION_DYNAMIC_FILTER', 'Dynamic Filter');

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: how to register new module I'm writing for 1.5?

    Glad you got the admin define - it took me a long time to uncover the information that that was even needed. I see you have copied from a mod that missed swguy's post:

    SET @cid=0;
    SELECT (@cid:=configuration_group_id) as cid

    http://www.zen-cart.com/forum/showpo...78&postcount=9

 

 

Similar Threads

  1. v151 No way for a shipping module to register an error
    By lat9 in forum Bug Reports
    Replies: 0
    Last Post: 11 Feb 2014, 06:20 PM
  2. writing new payment module: my bank does not accept redirect Url
    By Desmat in forum Addon Payment Modules
    Replies: 1
    Last Post: 28 Jan 2010, 06:04 PM
  3. Writing a new Payment Module
    By richard.rodriguez in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Dec 2009, 12:26 PM
  4. Register creat new account visual module?
    By marcopolo in forum General Questions
    Replies: 3
    Last Post: 9 Apr 2009, 07:46 PM
  5. Writing a new payment module - wiki no help
    By s_mack in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 16 Sep 2007, 08:04 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