Sending data to php function defined in another class with custom PHP code

Call a PHP function from another class in ChronoForms.

Overview

The issue occurs when trying to directly call a class method without properly including the file, and using incorrect variable references.
First, use the require_once statement to include the plugin file. Then, call the static method directly, passing the correct data object instead of using set or shortcodes.

se serguei_kp 06 Aug, 2020
Hello,
I'm trying to send data to an external function with this code in PHP code window:

$this->set("order", "{data:}")
plgSystemVirtuemart_ERP::createMergeOrderTaxibooking($order);

My function is defined in the system plugin:
class plgSystemVirtuemart_ERP extends JPlugin{.....
}

But it throws error.
Can you help me please.
I've tried with custom code without success.
Sending data to php function defined in another class with custom PHP code image 1
se serguei_kp 06 Aug, 2020
I found solution, this code works fine for me:

require_once(JPATH_PLUGINS.'/system/virtuemart_ERP/virtuemart_ERP.php');
plgSystemVirtuemart_ERP::createMergeOrderTaxibooking($this->data);
he healyhatman 06 Aug, 2020
Answer
For future reference, can't use shortcodes in PHP.

And $this->set sets a {var:} item. If you want a {data:} item set you want $this->data('name', 'value', true)
This topic is locked and no more replies can be posted.