Skip to main content

custom plugin for coupon

More
11 years 5 months ago - 11 years 5 months ago #199205 by diesel1984
-- HikaShop version -- : 2.2.3
-- Joomla version -- : 2.5.18
-- PHP version -- : 5

Hi,

I need to write a custom plugin for coupons. I have seen the "developer documentation" describing how to create a custom plugin and indeed i have written a custom plugin for hikashop before (albeit a long time ago). Ok so what i want to do is write a custom plugin for coupons - so im thinking of adding that custom plugin as follows:-

/plugins/hikashop/coupon/coupon.php

(for the above: is this the correct folder/file path for adding a coupon plugin?)

and then im thinking of adding code like so (to the coupon.php plugin file):-
Code:
class plgHikashopCoupon extends JPlugin { function plgHikashopCoupon(&$subject, $config) { parent::__construct($subject, $config); } function onBeforeCouponLoad(&$coupon,&$do) { } }

(for the above: am i extending the right class? or should i be extending a more specific coupon class? Also is my constructor function correct?)


Thanks for the help in advance!
Last edit: 11 years 5 months ago by diesel1984.

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #199216 by nicolas
Replied by nicolas on topic custom plugin for coupon
Hi,

That's correct so far.
Make sure that you also add the xml for your plugin and then zip both files and install the zip via the Joomla installer so that you can activate the plugin via the Joomla plugins manager.
The following user(s) said Thank You: diesel1984

Please Log in or Create an account to join the conversation.

Time to create page: 0.190 seconds
Powered by Kunena Forum