1

I'm trying to create vQmod XML file to avoid editing the core file directly in OpenCart. One of the XML I wanted to create is load some variables in database which this can be done in PHP but I'm not sure how to call the variable database in XML.

example in database
id  name
1   name1
2   name2
3   name3

If in PHP I can easily check what is the name of the id. But in XML I dont know how. thanks in advance.

P. Mergey
  • 313
  • 4
  • 18

1 Answers1

0

What about checking your variable using PHP inside your XML vQmod file, such as:

<?php
    if(empty($variable[$id]])){
        # Add a specific condition here
    }
?>

As a vQmod file can add operators to your core files, you can use PHP directly in your XML files (see the way I used it to retrieve the real image of a product for example).

Community
  • 1
  • 1
P. Mergey
  • 313
  • 4
  • 18