custom plugin for coupon

  • Posts: 32
  • Thank you received: 0
9 years 7 months ago #199205

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

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: 9 years 7 months ago by diesel1984.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 7 months ago #199216

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.052 seconds
Powered by Kunena Forum