-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25
-- Error-message(debug-mod must be tuned on) -- : none
I would like to create a file on a specific event, namely
. But whatever I try, I cannot get it to work. No file is created, wherever I search for it.
Am I searching at the wrong places for that file?
Is the function ever invoked?
How to debug plugins in general?
exampleexport.xml
<?xml version="1.0" encoding="utf-8"?>
<extension version="1.0" type="plugin" group="hikashoppayment" method="upgrade">
<name>Example Export</name>
<author>xxx</author>
<creationDate>March 2021</creationDate>
<copyright>Copyright (C) 2021 rights reserved.</copyright>
<license>Commercial</license>
<authorEmail>info@example.com</authorEmail>
<authorUrl>www.example.com</authorUrl>
<version>1.0.0</version>
<description>Example Export für HikaShop</description>
<files>
<filename plugin="exampleexport">exampleexport.php</filename>
</files>
<config>
</config>
</extension>
exampleexport.php
<?php
/**
* @package Joomla.Plugin
* @subpackage Hikashop.Exampleexporter
*
* @copyright Copyright (C) 2021 Example . All rights reserved.
*/
defined('_JEXEC') or die;
/**
* Joomla! Hikashop Exporter Plugin
*
* @since 3.2
*/
class plgHikashoppaymentExamplexporter extends JPlugin
{
function __construct(&$subject, $config) {
return parent::__construct($subject, $config);
}
public function OnAfterOderConfirm&$order, &$send_email)
{
//JLog::add('triggered on after order confirm', JLog::ERROR);
$filename = JPATH_ROOT . 'exports/asdf.txt';
JFile::write($filename, 'hukhuk');
//JFile::write('./local_asdf.txt', 'hukhuk local');
file_puts_content(JPATH_ROOT . 'exports/_file-puts-asdf.txt', 'hukhuk puts');
//$o = print_r($order);
//file_puts_content("./exports/orders.txt", "asdfasdfasdf" . $o);
}
}