I'm new to Joomla/Hikashop plugin,
I followed the guide at
www.hikashop.com/support/62-hikashop-dev...r-documentation.html
and i made a plain basic plugin that it doesn't seem to work, the same code put into the history plugin does work instead, probably i made some mistake during the install process:
1. I made a clone folder of /plugins/hikashop/history
2. I renamed this clone folder in /plugins/hikashop/credits
3. I renamed the xml file in /plugins/hikashop/credits/credits.xml
4. I renamed the php file in /plugins/hikashop/credits/credits.php
5. I opened credits.xml changing name tag, description and author tag, and the following tag:
<filename plugin="credits">credits.php</filename>
6. I went in Joomla extension manager -> discover -> I discovered my credits plugin -> I installed id and activated it
7. I edited /plugins/hikashop/credits/credits.php like this:
<?php
defined('_JEXEC') or die('Restricted access');
?><?php
class plgHikashopCredits extends JPlugin
{
function plgHikashopCredits(&$subject, $config){
parent::__construct($subject, $config);
}
function onAfterOrderUpdate(&$order,&$send_email){
if(!empty($order->order_id)){
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$columns = array('value');
$values = array($db->quote('ugo3333'));
$query
->insert($db->quoteName('les_test'))
->columns($db->quoteName($columns))
->values(implode(',', $values));
$db->setQuery($query);
$db->query();
}
return true;
}
}
The plugin does not work, the function is not triggered when updating an order satus.
My code DOES WORK if I paste it directly inside Hikashop History plugin inside its onAfterOrderUpdate function.
So the problem is not my code, what am I doing wrong? Thanks a lot in advance.
Joomla version: 3.2.0
Hikashop version: last free edition