VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: sanjanprem on August 18, 2012, 08:54:54 AM

Title: Trigger error - Trigger to VM shopper Plugin while VM shopper Save
Post by: sanjanprem on August 18, 2012, 08:54:54 AM
HI here I'm developing the plug in integrate with virtuemart component.
i want trigger a event when vm shopper saved on admin side.

i got an example of plug in for vm shopper in VM 2.0.8. That plug in is example file is vmshopperplugin.php

i have used the function plgVmAfterUserStore($data) in my plug in. but it fails to call my plug in?

if there any plug in functions for triggering while saving the vm shoppers?

Please Give some solutions.
Title: Re: Trigger error - Trigger to VM shopper Plugin while VM shopper Save
Post by: sanjanprem on August 22, 2012, 07:10:33 AM
hai, i have used the abstract class in my plug in, which is mentioned in virtuemart vmshopperplugin. it makes error,
abstract class plgvmShoppeplugin extends VmPlugin
{
}

then i have used the class like this,
class plgvmShoppeplugin extends VmPlugin{
}
i have see this in other payment plugins of virtuemart.
then it triggers the plug in.
Title: Re: Trigger error - Trigger to VM shopper Plugin while VM shopper Save
Post by: ivus on August 22, 2012, 07:55:26 AM
Hi sanjanprem,

Quote
hai, i have used the abstract class in my plug in, which is mentioned in virtuemart vmshopperplugin. it makes error,
abstract class plgvmShoppeplugin extends VmPlugin
{
}


Mine says

abstract class vmShopperPlugin extends VmPlugin
{
}


Quote
then i have used the class like this,
class plgvmShoppeplugin extends VmPlugin{
}
i have see this in other payment plugins of virtuemart.
then it triggers the plug in.

then shouldn't you be using it like so:

class plgVmShopperMyPluginName extends vmShopperPlugin{
}


Your class was trying to extend the VmPlugin, rather than the vmShopperPlugin...? if my assessment of your issue is correct.

ivus ;D