[Skip to main content](#vessel-content)

#   Why does my Plugin not create a file?

##

- **[loie](/forum/user/61072-loie "View loie's Profile")**
- [![loie's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61072-loie "View loie's Profile") Topic Author
- [ Offline](/forum/user/61072-loie)

Less More

- Posts: 2
- Thank you received: 0
-
-

5 years 7 months ago [\#331293](#331293) by [loie](/forum/user/61072-loie "View loie's Profile")  *[Why does my Plugin not create a file?](/forum/31-development/902281-why-does-my-plugin-not-create-a-file#331293 "-- 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  exampleexport.php")* was created by *[loie](/forum/user/61072-loie "View loie's Profile")*

-- 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 Code:

onAfterOrderConfirm

. 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 Code:

&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;extension version="1.0" type="plugin" group="hikashoppayment" method="upgrade"&gt; &lt;name&gt;Example Export&lt;/name&gt; &lt;author&gt;xxx&lt;/author&gt; &lt;creationDate&gt;March 2021&lt;/creationDate&gt; &lt;copyright&gt;Copyright (C) 2021 rights reserved.&lt;/copyright&gt; &lt;license&gt;Commercial&lt;/license&gt; &lt;authorEmail&gt;info@example.com&lt;/authorEmail&gt; &lt;authorUrl&gt;www.example.com&lt;/authorUrl&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;description&gt;Example Export für HikaShop&lt;/description&gt; &lt;files&gt; &lt;filename plugin="exampleexport"&gt;exampleexport.php&lt;/filename&gt; &lt;/files&gt; &lt;config&gt; &lt;/config&gt; &lt;/extension&gt;

exampleexport.php Code:

&lt;?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(&amp;$subject, $config) { return parent::__construct($subject, $config); } public function OnAfterOderConfirm&amp;$order, &amp;$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); } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjI4MS13aHktZG9lcy1teS1wbHVnaW4tbm90LWNyZWF0ZS1hLWZpbGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 7 months ago [\#331308](#331308) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Why does my Plugin not create a file?](/forum/31-development/902281-why-does-my-plugin-not-create-a-file#331308 "-- 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  exampleexport.php")*

Hi,

The onAfterOrderConfirm function of a payment plugin will be called by HikaShop after the end of the checkout, after the customer confirms the creation of the order if the payment method corresponding to the plugin is selected as payment method.
So this function is normally only implemented by payment plugins, and mainly to redirect the customer to the payment gateway.

I think that it's not what you want to do. I think you want to develop a plugin of the group "hikashop" and implement the "onAfterOrderCreate(&amp;$order)" and "onAfterOrderUpdate(&amp;$order)" triggers and check the value of $order-&gt;order_status and $order-&gt;old-&gt;order_status so that when the order's status changes from "created" to "confirmed" you can do your processing.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjI4MS13aHktZG9lcy1teS1wbHVnaW4tbm90LWNyZWF0ZS1hLWZpbGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[loie](/forum/user/61072-loie "View loie's Profile")**
- [![loie's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61072-loie "View loie's Profile") Topic Author
- [ Offline](/forum/user/61072-loie)

Less More

- Posts: 2
- Thank you received: 0
-
-

5 years 7 months ago [\#331363](#331363) by [loie](/forum/user/61072-loie "View loie's Profile")  Replied by *[loie](/forum/user/61072-loie "View loie's Profile")* on topic *[Why does my Plugin not create a file?](/forum/31-development/902281-why-does-my-plugin-not-create-a-file#331363 "-- 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  exampleexport.php")*

HI!
Thank you for your hints.
I've changed my xml file to use hikashop now. But still there are no files created, which I don't understand. At least *somewhere* , there should be a file, am I right?
Code:

&lt;extension version="1.0" type="plugin" group="hikashop" method="upgrade"&gt;

and updated my .php file to look like this:
Code:

&lt;?php defined('_JEXEC') or die; class plgHikashopExampleexporter extends JPlugin { function __construct(&amp;$subject, $config) { return parent::__construct($subject, $config); } public function onAfterOrderCreate(&amp;$order) { //JLog::add('triggered on after order confirm', JLog::ERROR); $filename = JPATH_ROOT . '/asdf-create.txt'; JFile::write($filename, $order-&gt;order_status); JFile::write('./local_asdf-create.txt', 'hukhuk local'); file_puts_content(JPATH_ROOT . 'exports/_file-puts-asdf-create.txt', 'hukhuk puts'); //$o = print_r($order); //file_puts_content("./exports/orders.txt", "asdfasdfasdf" . $o); } public function onAfterOrderUpdate(&amp;$order) { $filename = JPATH_ROOT . '/asdf-update.txt'; JFile::write($filename, $order-&gt;order_status); JFile::write('./local_asdf-update.txt', 'hukhuk local'); file_puts_content(JPATH_ROOT . 'exports/_file-puts-asdf-update.txt', 'hukhuk puts'); } }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjI4MS13aHktZG9lcy1teS1wbHVnaW4tbm90LWNyZWF0ZS1hLWZpbGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

5 years 7 months ago [\#331367](#331367) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Why does my Plugin not create a file?](/forum/31-development/902281-why-does-my-plugin-not-create-a-file#331367 "-- 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  exampleexport.php")*

Hello,

Your plugin is called "exampleexport", not "exampleexporter".
Thus the class name is not correct and won't be loaded by Joomla.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwMjI4MS13aHktZG9lcy1teS1wbHVnaW4tbm90LWNyZWF0ZS1hLWZpbGU/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
