[Skip to main content](#vessel-content)

#   How to include Hikashop environment in RSForms

##

- **[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")**
- [![dkmetz@taylorbruce.com's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile") Topic Author
- [ Offline](/forum/user/11254-dkmetz-taylorbruce-com)

Less More

- Posts: 69
- Thank you received: 1
-
-
-
-

11 years 5 months ago -  11 years 5 months ago [\#202344](#202344) by [dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")  *[How to include Hikashop environment in RSForms](/forum/31-development/877087-how-to-include-hikashop-environment-in-rsforms#202344 "-- 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&#95;html/administrator/components/com&#95;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:  and this is the result page:  I am not able to get the product&#95;id value. Can you please tell me what I am doing wrong?  Dennis")* was created by *[dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile")*

-- 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:
Code:

echo ("1 about to include ===&gt; ".JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php' . "&lt;br /&gt;"); include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php'); if (!class_exists('hikashop')) { echo ("2 about to include ===&gt; ".JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php' . "&lt;br /&gt;"); include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/helpers/helper.php'); } if (!class_exists('hikashopProductClass')) { echo ("3 about to include===&gt; " . JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/classes/product.php' . "&lt;br /&gt;"); include(JPATH_ADMINISTRATOR . DS . 'components/com_hikashop/classes/product.php'); } if (class_exists('hikashop')) echo ("1a hikashop class is available! &lt;br /&gt;"); if (class_exists('hikashopProductClass')) echo ("3a hikashopProductClass class is available! &lt;br /&gt;"); $pid = $jinput-&gt;get('cid', 'default_value', 'raw'); echo ("pid is " . $pid); $productClass = hikashop_get('class.product'); $productID = $productClass-&gt;get($pid-&gt;product_id); echo ("Product ID is ==&gt;" . $productID ); return $productID ;

and this is the result page:

> 1 about to include ===&gt; /home/steineri/public\_html/administrator/components/com\_hikashop/helpers/helper.php
> 3 about to include===&gt; /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 ==&gt;1

I am not able to get the product_id value. Can you please tell me what I am doing wrong?

Dennis

---

\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Dennis Kmetz

Last edit: 11 years 5 months ago by [dkmetz@taylorbruce.com](/forum/user/11254-dkmetz-taylorbruce-com "View dkmetz@taylorbruce.com's Profile"). Reason: forgot last few lines of code

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzA4Ny1ob3ctdG8taW5jbHVkZS1oaWthc2hvcC1lbnZpcm9ubWVudC1pbi1yc2Zvcm1zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

11 years 5 months ago -  11 years 5 months ago [\#202361](#202361) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to include Hikashop environment in RSForms](/forum/31-development/877087-how-to-include-hikashop-environment-in-rsforms#202361 "-- 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&#95;html/administrator/components/com&#95;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:  and this is the result page:  I am not able to get the product&#95;id value. Can you please tell me what I am doing wrong?  Dennis")*

In your code you have the line:
echo ("pid is " . $pid);

And it displays as:
pid is 1095

So $pid is an integer.
Then, you have the line:
$productID = $productClass-&gt;get($pid-&gt;product_id);
where you use $pid as if it was an object with an attribute called "product_id" in it.
You probably want to write instead:
$productID = $productClass-&gt;get($pid);

Also note that the return of the get function of the product class is an object with all the data of the product and not an int/string, so you can't just echo it like you do on the next line.

Last edit: 11 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzA4Ny1ob3ctdG8taW5jbHVkZS1oaWthc2hvcC1lbnZpcm9ubWVudC1pbi1yc2Zvcm1zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Bobwales](/forum/user/30257-bobwales "View Bobwales's Profile")**
- [![Bobwales's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30257-bobwales "View Bobwales's Profile")
- [ Offline](/forum/user/30257-bobwales)

Less More

- Posts: 127
- Thank you received: 6
-
-

9 years 5 months ago [\#269525](#269525) by [Bobwales](/forum/user/30257-bobwales "View Bobwales's Profile")  Replied by *[Bobwales](/forum/user/30257-bobwales "View Bobwales's Profile")* on topic *[How to include Hikashop environment in RSForms](/forum/31-development/877087-how-to-include-hikashop-environment-in-rsforms#269525 "-- 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&#95;html/administrator/components/com&#95;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:  and this is the result page:  I am not able to get the product&#95;id value. Can you please tell me what I am doing wrong?  Dennis")*

Don't want to hijack this thread, but have a requirement to use RSForms in product descriptions.

By inserting code similar to
{rsform 1}
inside any article text, including the description text field of a Hikashop product, displays the form.
And that form can be pre-populated using similar to
{rsform 1 fieldName="fieldValue" textbox="textboxValue" radioGroup="someValue" checkbox="cat" checkbox="dog"}

I'd like to pre-populate the form with the current product price. (In my case the form will illustrate the finance terms of our bikes when purchased on credit).

Is there a way to do this using this simple format? A bit like {rsform 1 bikeprice="&lt;script&gt;some php code that extracts current price&lt;/script&gt;}

I don't really want to edit the View that we use as not all products would be appropriate to the form. It would be more manageable to insert the form into a product description.

Help or ideas would be much appreciated.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzA4Ny1ob3ctdG8taW5jbHVkZS1oaWthc2hvcC1lbnZpcm9ubWVudC1pbi1yc2Zvcm1zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 5 months ago [\#269527](#269527) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to include Hikashop environment in RSForms](/forum/31-development/877087-how-to-include-hikashop-environment-in-rsforms#269527 "-- 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&#95;html/administrator/components/com&#95;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:  and this is the result page:  I am not able to get the product&#95;id value. Can you please tell me what I am doing wrong?  Dennis")*

Hi,

I don't see a way to do it without modifying the view. I'm however not familiar with RSForms.
Also, based on how your product page is customized, you might have a problem with the RSForms form being inside the product page main form. Because having a form in a form is not valid in HTML.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzA4Ny1ob3ctdG8taW5jbHVkZS1oaWthc2hvcC1lbnZpcm9ubWVudC1pbi1yc2Zvcm1zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.059 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
