E
E
Eugene Simon2019-10-11 13:27:56
opencart
Eugene Simon, 2019-10-11 13:27:56

How to execute sql query when installing ocmod in opencar 3?

In opencart 2, it was possible to add install.sql and install.php with sql queries to ocmod, but this does not work in 3-ke.
How now to add rows, columns and new tables to the database through ocmod?
I was told that it is possible to create install and unistal methods in the model and call them when installing ocmod, but I do not have enough experience to think of it myself. I tried to parse free modules on opencart 3 for an example, but there are very few of them and I did not find a module with sql queries ALTER TABLE
And all you need to do is just add 1 column to oc_product....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
web-mechanic, 2019-12-03
@amfetamine

create the install() method on the admin side and put the sql query there, when installing the module in the modules section, the sql query will be executed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question