-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.5.17
-- Error-message(debug-mod must be tuned on) -- : Notice: Trying to get property of non-object in /home/steineri/public_html/administrator/components/com_rsform/helpers/rsform.php(552) : eval()'d code on line 43
Hi,
I am writing a RSForms PHP script and would like to access the Hikashop classes/helpers. I cannot seem to get things to work. Here is the code I am having an issue with:
echo ("1 about to include ===> ".JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php' . "<br />");
include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php');
if (!class_exists('hikashop')) {
echo ("2 about to include ===> ".JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php' . "<br />");
include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php');
}
if (!class_exists('hikashopProductClass')) {
echo ("3 about to include===> " . JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/classes/product.php' . "<br />");
include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/classes/product.php');
}
if (class_exists('hikashop')) echo ("1a hikashop class is available! <br />");
if (class_exists('hikashopProductClass')) echo ("3a hikashopProductClass class is available! <br />");
$pid = $jinput->get('cid', 'default_value', 'raw');
echo ("pid is " . $pid);
$productClass = hikashop_get('class.product');
$productID = $productClass->get($pid->product_id);
echo ("Product ID is ==>" . $productID );
return $productID ;
and this is the result page:
1 about to include ===> /home/steineri/public_html/administrator/components/com_hikashop/helpers/helper.php
3 about to include===> /home/steineri/public_html/administrator/components/com_hikashop/classes/product.php
1a hikashop class is available!
3a hikashopProductClass class is available!
pid is 1095
Notice: Trying to get property of non-object in /home/steineri/public_html/administrator/components/com_rsform/helpers/rsform.php(552) : eval()'d code on line 43
Product ID is ==>1
I am not able to get the product_id value. Can you please tell me what I am doing wrong?
Dennis