Keyword

retrieve plugins parameters in K2 v2.5.4 - J1.7

More
12 years 7 months ago #62580 by Luca
Hallo
I need to get some plugins parameters within a item.php view.
I have to get the k2store SKU field which is stored as {"k2storeitem_sku":"APE004","k2storeitem_price":"9999","k2storeitem_tax":"0","k2storeitem_shipping":"1"}
in the item record
I have done the following
$pluginParams = new K2Parameter($this->item->plugins,'','k2store');
echo '<pre>';
print_r( $pluginParams );
echo '</pre>';

which returns the following

K2Parameter Object
(
[namespace] => k2store
[_raw:protected] => {"k2storeitem_sku":"APAR002","k2storeitem_price":"9999","k2storeitem_tax":"0","k2storeitem_shipping":"1"}
[_xml:protected] =>
[_elements:protected] => Array
(
)

[_elementPath:protected] => Array
(
[0] => /var/www/vhosts/xxxxx.it/httpdocs/libraries/joomla/html/parameter/element
[1] => /var/www/vhosts/xxxxx.it/httpdocs/administrator/components/com_k2/elements
)

[data:protected] => stdClass Object
(
[k2storeitem_sku] => APAR002
[k2storeitem_price] => 9999
[k2storeitem_tax] => 0
[k2storeitem_shipping] => 1
)

)

but at this point I cannot get the k2storeitem_sku as the data is protected. Can you please tell me how to solve this?

Thank you!

Luca

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


Powered by Kunena Forum