VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: ydl on December 07, 2015, 08:39:21 AM

Title: custom field plug-ins - does not get the list of plug-ins
Post by: ydl on December 07, 2015, 08:39:21 AM
I create a custom plug-in.

The plug-in constructor is invoked BUT non of other functions.

I understood from the docs that I have to define the plug-in in the custom field, so I tried to setup a new custom field of the type plug-ins BUT the list of plug-ins didn't apear

Can anyone point out to a document or explain how to use it?

Thank in advance!
Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: GJC Web Design on December 07, 2015, 12:35:18 PM
as soon as I install any vmcustom plugin it is available in the customfields "Additional Parameters" if I choose type plugin

is your xml correct

e.g.   <extension method="upgrade" version="1.5" type="plugin" group="vmcustom" >

Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: ydl on December 07, 2015, 13:23:42 PM
Now I see it...

I add some "echo" to see if I reach the plug-ins function... only the constructor is reach...

The functions:
- plgVmOnViewCart
- plgVmOnViewCartVM3
- plgVmOnDisplayProductFE
etc.
are never reach !?

Any sugestion how to debug it?
Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: GJC Web Design on December 08, 2015, 01:04:33 AM
what do u mean reached?

if your syntax is correct the function is triggered when called by the dispatcher

do a general file search for functions

e.g. in customfields  model

if (!class_exists ('vmCustomPlugin')) {
            require(VMPATH_PLUGINLIBS . DS . 'vmcustomplugin.php');
         }

         if ($customfield->field_type == "E") {

            JPluginHelper::importPlugin ('vmcustom');
            $dispatcher = JDispatcher::getInstance ();
            $ret = $dispatcher->trigger ('plgVmOnDisplayProductFEVM3', array(&$product, &$customfields[$k]));
            continue;
         }

Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: ydl on December 08, 2015, 09:07:38 AM
When I wrote 'reach' I meant 'trigger'...

What I see now is that the plug-ins functions a triggered in the back-end BUT not in the front-end

Did I missed something?
Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: GJC Web Design on December 08, 2015, 09:44:19 AM
the FE uses the BE models..

there are some triggers for the FE in the helpers & views FE

just do a general search for "plgVm"
Title: Re: custom field plug-ins - does not get the list of plug-ins
Post by: ydl on December 08, 2015, 10:28:57 AM
Quotethe FE uses the BE models..
I know...
Quotethere are some triggers for the FE in the helpers & views FE
I check the plugin that come with the system - 'specification' - I check 'plgVmOnDisplayProductFE' witch exist in the code and added my own 'plgVmOnDisplayProductFEVM3' - none of them reach in the FE

I also put a print in "VirtueMartCustomFieldRenderer::renderCustomfieldsFE" and it does not trigger in FE!!!