S
S
Sergey Miller2021-03-27 14:53:49
opencart
Sergey Miller, 2021-03-27 14:53:49

How to get email field value from OpenCart 3.0.3.3 API admin panel?

I did not find a normal dock on oc api. Anyone share a link?

What do I need to do? In a third-party file, at the root of the site, I need to get the value of the email field from the admin panel ( config_email ). How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Miller, 2021-03-27
@blackseabreathe

For those who are interested, they helped me on the oc forum

// Version
define('VERSION', '3.0.3.3');

// Configuration
require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');

// Startup
require_once(DIR_SYSTEM . 'startup.php');

// DB
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE, DB_PORT);

$query = $db->query("SELECT `value` FROM `" . DB_PREFIX . "setting` WHERE `key` = 'config_email' AND `store_id` = 0 LIMIT 1"); 
if ($query->num_rows) {
  $email = $query->row['value'];
} else {
  $email = 'не найдено';
}

echo 'Email магазина: ' . $email;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question