Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default sort_order in Configuration table insert

    Hi,
    at the risk of exposing my ignorance I have a geek question.

    In the interests of cleaning up a shoddy payment module supplied by my bank (Cajastur, Spain), I have been delving into the code.
    I have done the essential stuff and now I am looking for how to change the displayed order of the data entry fields in the Admin for the module.
    i.e. How they are presented vertically to the user.

    In all the payment modules there is something like this for the install function:

    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

    My questions are,
    1) what is the "sort_order" field? As you can see, here it is '0' near the end. If it has something to do with the admin order I can't figure it out as many share the same number.
    2) if it has nothing to do with the order, then how DO you change the field order as shown in the admin?

    thanks
    Steve

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

    Default Re: sort_order in Configuration table insert

    1. Sort Order will be the display order of the Payment Modules or Shipping Modules or Order Total Module ...

    This allows you to change the order when Editing the Module in your Zen Cart Admin ...
    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: v1.5.5]
    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!

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

    Default Re: sort_order in Configuration table insert

    2. Change the order in which the keys are listed in the keys() function.
    .

    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.

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: sort_order in Configuration table insert

    Doh!
    I should have known better than bleary posting last thing at night.

    Thanks Ajeh for answering the (dumb) question I appeared to ask, but not what I really wanted to know.

    I chose that execute at random and didn't notice (!) it had three references to sort order in it...

    Dr.Byte you answered the original real question I had, but now just for interest, what is sort_order in these field entries?

    Here you see the install options for two data field entry items that appear in admin for this module.

    1) $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or captured immediately?', '6', '0', 'zen_cfg_select_option(array(\'Authorize\', \'Capture\'), ', now())");

    2) $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");

    They are all "0" or "2" in this module.

    cc.php has 130,131,132,134,135.
    Paypal.php has 0,2,3,4,5,6,7,8,18,20,22,25,73,25,71,1,72

    I just don't trust anything in this module I am working on and after a lot of time on the learning curve I (now) understand everything else I have found, so this is the last bit,

    thanks
    Steve

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

    Default Re: sort_order in Configuration table insert

    The sort order in the configuration keys for payment/shipping/order-total modules is irrelevant. It's part of similar infrastructure used for handling configuration values in the other config menus, and in those cases the sort order denotes the order in which they appear for editing. But for the various "modules", it's ignored entirely.
    .

    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.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: sort_order in Configuration table insert

    What a time waster!
    Thanks for that,
    Steve

 

 

Similar Threads

  1. insert in to in table
    By abaco in forum General Questions
    Replies: 2
    Last Post: 10 Dec 2010, 09:03 AM
  2. $box_categories_array[i]['sort_order'] ?
    By scatzc in forum General Questions
    Replies: 15
    Last Post: 24 Aug 2010, 09:44 PM
  3. horizontal menu table, where to insert?
    By LaTonta in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 21 Sep 2009, 02:07 AM
  4. insert attributes into a table
    By davidpiddington in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 Jul 2009, 03:32 AM

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