How to show add more/remove field section in payment gateway configuration page

  • Posts: 21
  • Thank you received: 0
3 years 9 months ago #321881

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.3

Hello,

I am integrating a custom payment gateway and I managed to install and show all required fields under Specific configuration section.
Now I want one more section which will contain multiple Value and Title field with remove button something like below :



I did R&D but did not find a way to create something like this for my payment gateway. So please let me know how to create this kind of custom section and save data in db.

Thanks

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
3 years 9 months ago #321886

Hi,

In your plugin, you can add a function pluginConfigDisplay($optionType, $extraOption, $type, $paramsType, $key, $element, $options) and return the HTML you want. That way, you can create new type of options for the $pluginConfig attribute at the beginning of your plugin. When the type you set there is not known, the system will call your pluginConfigDisplay function so that it can return the HTML you want to be displayed.
And you can add another function called onPaymentConfigurationSave(&$element) to be called when the payment method is being saved so that you can take the data from the POST and add it in the object $element->payment_params as extra attributes or in another table of your plugin or eslewhere.

Please Log in or Create an account to join the conversation.

Time to create page: 0.064 seconds
Powered by Kunena Forum