News:

Looking for documentation? Take a look on our wiki

Main Menu

plugin params

Started by AnthonyWang, March 16, 2016, 09:21:50 AM

Previous topic - Next topic

AnthonyWang

$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!
Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

GJC Web Design

just remove the &

$plugin = JPluginHelper::getPlugin('vmcustom', 'myplug');
   $paramsgjc = new JRegistry($plugin->params);
   $xxxxx = $paramsgjc->get('xxxxx', 1);
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AnthonyWang

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

Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

GJC Web Design

and what do see when

print 'Debug Line '.__LINE__.' $params <pre>'; print_r ($params); print "</pre><br />\n";
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AnthonyWang

thanks for reply,it's return
Line 87 $params

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

    [separator] => .
)

Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

GJC Web Design

can you see a "normal" Joomla plugin? 
this code is what I use in my extensions
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AnthonyWang

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
Currently using :
Joomla 3.6.5 / Virtuemart 3.2.1 / PHP 5.5.9-1ubuntu4.17

Studio 42

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.