I am developing a payment module for Virtuemart. The test_payment.xml configuration file looks like this:

 <?xml version="1.0" encoding="utf-8"?> <extension version="2.5" type="plugin" group="vmpayment" method="upgrade"> <name>VM Payment - Test</name> <author>Test</author> <version>1.0.0</version> <description>Test payment</description> <files> <filename plugin="test_payment">test_payment.php</filename> </files> <config> <fields name="params"> <fieldset name="basic"> <field name="merchant" type="text" size="20" label="Логин" description="" default="" /> <field name="password" type="text" size="20" label="Пароль" description="" default="" /> <field name="test" type="list" default="1" label="Режим теста" description=""> <option value="1">Включен</option> <option value="0">Выключен</option> </field> <field name="step" type="list" default="1" label="Стадийность" description=""> <option value="1">Одностадийный платеж</option> <option value="2">Двухстадийный платеж</option> </field> </fieldset> </fields> </config> </extension> 

When adding a new payment method and saving the configuration to the database, the following line is saved in the payment_params table in the payment_params field:

 merchant="test"|password="test"|test="0"|step="2"| 

But at the same time, the fields on the configuration page still remain empty / default. Tell me why, after saving the settings, they are not displayed on the page?

Joomla v3.5.1, Virtuemart v3.0.14

  • How is your xml related to the data that is stored in the database and the data that is displayed on the page? There is no connection between these components in this interpretation of the question. - MasterAlex
  • The @MasterAlex implementation of saving and outputting data is hidden in the vmPlugin parent vmPlugin . The developer only needs to write the correct xml . - MichaelPak
  • Try clearing your cache - Vanya Avchyan
  • probably the answer is obvious, if the data is sent and they are in the database, and are not output after sending, then it is probably necessary to lay out the file in which it should be displayed, and there will be standard values ​​that are not loaded from the database, or it incorrectly loads from the database !!! generally it is necessary the code of that part which displays, the key code does not play a key here ..... I think so. - Vladimir Ch

1 answer 1

It turned out that for VirtueMart version 3, you must override the plgVmDeclarePluginParamsPaymentVM3 method of the plgVmDeclarePluginParamsPaymentVM3 class:

 function plgVmDeclarePluginParamsPaymentVM3(&$data) { return $this->declarePluginParams('payment', $data); }