VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: AnthonyWang on March 16, 2016, 09:21:50 AM

Title: plugin params
Post by: AnthonyWang on March 16, 2016, 09:21:50 AM
$plugin = &JPluginHelper::getPlugin('vmcustom', 'myplg');
$pluginparams = new JRegistry($plugin->params);
$paramvalue = $pluginparams->get('myparameter');
echo $paramvalue;

the warning message:
QuoteStrict Standards: Only variables should be assigned by reference in ...........................
it's not working after update vm3.x,
how can i get plugin params value now?

many thanks!
Title: Re: plugin params
Post by: GJC Web Design on March 16, 2016, 10:37:45 AM
just remove the &

$plugin = JPluginHelper::getPlugin('vmcustom', 'myplug');
   $paramsgjc = new JRegistry($plugin->params);
   $xxxxx = $paramsgjc->get('xxxxx', 1);
Title: Re: plugin params
Post by: AnthonyWang on March 16, 2016, 11:26:38 AM
Thanks GJC,
but its not work for me on category page,
i did input Size of input 20 in textinput  customfields
and i put this code in category/default.php,but  it's only output 1,
for example:
$plugin = JPluginHelper::getPlugin('vmcustom', 'textinput');
$params = new JRegistry($plugin->params);
echo $params->get('custom_size',1);

Title: Re: plugin params
Post by: GJC Web Design on March 16, 2016, 14:03:09 PM
and what do see when

print 'Debug Line '.__LINE__.' $params <pre>'; print_r ($params); print "</pre><br />\n";
Title: Re: plugin params
Post by: AnthonyWang on March 16, 2016, 14:38:12 PM
thanks for reply,it's return
Line 87 $params

Joomla\Registry\Registry Object
(
    [data:protected] => stdClass Object
        (
        )

    [separator] => .
)

Title: Re: plugin params
Post by: GJC Web Design on March 17, 2016, 10:15:09 AM
can you see a "normal" Joomla plugin? 
this code is what I use in my extensions
Title: Re: plugin params
Post by: AnthonyWang on March 18, 2016, 04:53:33 AM
Hello GJC,
just change xml config,it's will show joomla normal plugin,
but in joomla normal plugin,it's not the same selected data with customfields
Title: Re: plugin params
Post by: Studio 42 on March 18, 2016, 14:23:37 PM
YOu cannot use Joomla way to get parameters.
Joomla have 1 parameters declaration for same plugin.
VM can have multiple parameters declarations for same plugin.