ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

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.
PHP_code.JPG
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.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com