0

i have just installed opencart 2.3.0.2 and vqmod but i am facing a problem now. In previous version of opencart when i was using the below code in vqmod xml file

global $config;
$variableA =  $config->get('field_value');

then in $variableA i got the value which i saved in the db from admin section but now in 2.3.0.2 when i use this code it shows fatal error

Fatal error: Call to a member function get() on null 

please tell me how can i get the value in vqmod xml file so i can use this variable further

Thanks

kanenas
  • 869
  • 1
  • 20
  • 37
Deepak Goyal
  • 1,186
  • 2
  • 13
  • 26

1 Answers1

1

Define the variable in a file controller first:

$data['variableA'] = $this->config->get('variableA');

then (for example) echo the variable in a view file:

<?php echo $variableA; ?>

kanenas
  • 869
  • 1
  • 20
  • 37
  • thanks for your suggestion now i have also call controller code in vqmode xml fine and as you provide the code its working – Deepak Goyal Jun 28 '17 at 09:47