5

I am newbie in opencart as well as in php. I am discovering opencart templates, I found $this->config->get this line, I am a little bit confused about this. I don't understand clearly. This request we are using this object (current) access config object and call get method of config object, am I right ?
I have read that get query data from database. This data is set from admin panel.

So here are questions :
1. Where can I find config object declaration
2. Get uses simple query to retrieve data from database ?
3. How can I add my own fields, I mean how can I add some fields in admin panel, for instance in category configuration to use them in this way $this->config->get.

I would be grateful for any help.

Aman Gupta - ΔMΔN
  • 2,971
  • 2
  • 19
  • 39

1 Answers1

8
  1. <OC_ROOT>/system/library/config.php
  2. What do you mean by simple query? if SELECT <COLUMN[S]> FROM <TABLE> WHERE <CONDITION[S]> is simple for you, then yes
  3. Too broad for answering here. Check the code for how the administration settings are handled, or settings from certain extensions/modules and You'll see. Basically if you insert some new rows into the setting table and provide a unique key for that setting you can retrieve it by calling $this->config->get('<KEY>');.
shadyyx
  • 15,825
  • 6
  • 60
  • 95