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

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
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);
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)
serguei_kp 07 Aug, 2020
Thank you for the information!
This topic is locked and no more replies can be posted.