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

#   Nothing appends with a simple plugin

##

- **[webcrea](/forum/user/20598-webcrea "View webcrea's Profile")**
- [![webcrea's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar20598.jpg)](/forum/user/20598-webcrea "View webcrea's Profile") Topic Author
- [ Offline](/forum/user/20598-webcrea)

Less More

- Posts: 19
- Thank you received: 0
-
-
-
- [](http://www.webcrea.fr)
-

11 years 8 months ago [\#191042](#191042) by [webcrea](/forum/user/20598-webcrea "View webcrea's Profile")  *[Nothing appends with a simple plugin](/forum/31-development/875045-nothing-appends-with-a-simple-plugin#191042 "-- url of the page with the problem -- : localhost -- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.13  I don't understand, I try to do something with a very simple plugin  class plgHikashopMembership extends JPlugin { function plgHikashopMembership(&amp;$subject, $config){ parent::&#95;&#95;construct($subject, $config); if(!isset($this-&gt;params)){ $plugin = JPluginHelper::getPlugin('hikashop', 'membership'); if(version&#95;compare(JVERSION,'2.5','params = new JParameter($plugin-&gt;params); } else { $this-&gt;params = new JRegistry($plugin-&gt;params); } } }  function onAfterOrderCreate(&amp;$order,&amp;$send&#95;email){ return $this-&gt;onAfterOrderUpdate($order,$send&#95;email); }  function onAfterOrderUpdate(&amp;$order,&amp;$send&#95;email){ $mainframe = JFactory::getApplication(); $mainframe-&gt;enqueueMessage('The customer '); return true; }  function onAfterOrderDelete($elements){ $mainframe-&gt;enqueueMessage('Order delete '); return true; }  function onProductBlocksDisplay(&amp;$product, &amp;$html){ $mainframe-&gt;enqueueMessage('Produit id = '.$product-&gt;product&#95;id); return true; } }  and nothing appends  the plugin is activate and when I include an error, I have an error, I'm sure is running but no message appears")* was created by *[webcrea](/forum/user/20598-webcrea "View webcrea's Profile")*

-- url of the page with the problem -- : localhost
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.4
-- PHP version -- : 5.3.13

I don't understand, I try to do something with a very simple plugin

class plgHikashopMembership extends JPlugin
{
function plgHikashopMembership(&amp;$subject, $config){
parent::__construct($subject, $config);
if(!isset($this-&gt;params)){
$plugin = JPluginHelper::getPlugin('hikashop', 'membership');
if(version_compare(JVERSION,'2.5','&lt;')){
jimport('joomla.html.parameter');
$this-&gt;params = new JParameter($plugin-&gt;params);
} else {
$this-&gt;params = new JRegistry($plugin-&gt;params);
}
}
}

function onAfterOrderCreate(&amp;$order,&amp;$send_email){
return $this-&gt;onAfterOrderUpdate($order,$send_email);
}

function onAfterOrderUpdate(&amp;$order,&amp;$send_email){
$mainframe = JFactory::getApplication();
$mainframe-&gt;enqueueMessage('The customer ');
return true;
}

function onAfterOrderDelete($elements){
$mainframe-&gt;enqueueMessage('Order delete ');
return true;
}

function onProductBlocksDisplay(&amp;$product, &amp;$html){
$mainframe-&gt;enqueueMessage('Produit id = '.$product-&gt;product_id);
return true;
}
}

and nothing appends

the plugin is activate and when I include an error, I have an error, I'm sure is running but no message appears

---

Christophe
[ www.webcrea.fr](http://www.webcrea.fr)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NTA0NS1ub3RoaW5nLWFwcGVuZHMtd2l0aC1hLXNpbXBsZS1wbHVnaW4/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")
- [ Away](/forum/user/63-nicolas)

Less More

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

11 years 8 months ago [\#191050](#191050) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Nothing appends with a simple plugin](/forum/31-development/875045-nothing-appends-with-a-simple-plugin#191050 "-- url of the page with the problem -- : localhost -- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.4 -- PHP version -- : 5.3.13  I don't understand, I try to do something with a very simple plugin  class plgHikashopMembership extends JPlugin { function plgHikashopMembership(&amp;$subject, $config){ parent::&#95;&#95;construct($subject, $config); if(!isset($this-&gt;params)){ $plugin = JPluginHelper::getPlugin('hikashop', 'membership'); if(version&#95;compare(JVERSION,'2.5','params = new JParameter($plugin-&gt;params); } else { $this-&gt;params = new JRegistry($plugin-&gt;params); } } }  function onAfterOrderCreate(&amp;$order,&amp;$send&#95;email){ return $this-&gt;onAfterOrderUpdate($order,$send&#95;email); }  function onAfterOrderUpdate(&amp;$order,&amp;$send&#95;email){ $mainframe = JFactory::getApplication(); $mainframe-&gt;enqueueMessage('The customer '); return true; }  function onAfterOrderDelete($elements){ $mainframe-&gt;enqueueMessage('Order delete '); return true; }  function onProductBlocksDisplay(&amp;$product, &amp;$html){ $mainframe-&gt;enqueueMessage('Produit id = '.$product-&gt;product&#95;id); return true; } }  and nothing appends  the plugin is activate and when I include an error, I have an error, I'm sure is running but no message appears")*

Hi,

The code looks ok. So I would recommend to check your plugin XML. It needs to match with the class name of the php file.
I'm suspecting that the class name is wrong in your php file based on what you put in the XML file and thus Joomla is looking for another class name which it doesn't find in the file and thus just doesn't run your code. You get the error because it's a parsing error and PHP parses the file in order to check for the class but that doesn't mean that the class name is correct for what Joomla expects.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NTA0NS1ub3RoaW5nLWFwcGVuZHMtd2l0aC1hLXNpbXBsZS1wbHVnaW4/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.039 seconds

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