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

#   Correct way to pass field data to my script?

##

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

Less More

- Posts: 7
- Thank you received: 0
-
-

13 years 2 months ago [\#116797](#116797) by [eleventy](/forum/user/25916-eleventy "View eleventy's Profile")  *[Correct way to pass field data to my script?](/forum/31-development/860573-correct-way-to-pass-field-data-to-my-script#116797 "-- HikaShop version -- : 2.2.0 -- Joomla version -- : 3.1.4 -- PHP version -- : 5.3.27  Hi guys  I am beginning an exciting journey in Hikashop custom plugin development! Yay! B)  I have a basic function like this:  Is using queries a good or bad way to get the field data from multiple tables into my script? Is there an easier way? I guess my main problem is I don't understand how to make use of the $order object properly?  Any help would be marvellous :)  All the best Eleventy")* was created by *[eleventy](/forum/user/25916-eleventy "View eleventy's Profile")*

-- HikaShop version -- : 2.2.0
-- Joomla version -- : 3.1.4
-- PHP version -- : 5.3.27

Hi guys

I am beginning an exciting journey in Hikashop custom plugin development! Yay! ![B)](/media/kunena/emoticons/1.png "B)")

I have a basic function like this:
Code:

class plgHikashopkf_insert extends JPlugin { function plgHikashopKashflow(&amp;$subject, $config){ parent::__construct($subject, $config); if(!isset($this-&gt;params)){ $plugin =&amp; JPluginHelper::getPlugin('hikashop', 'kf_insert'); jimport('joomla.html.parameter'); $this-&gt;params = new JParameter( $plugin-&gt;params ); } } function onAfterOrderCreate(&amp;$order,&amp;$send_email){ if(!empty($order-&gt;order_id)){ $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $from = "no_replies_please@********.co.uk"; $headers .= "From:".$from; $email_add = '*******.net'; $subject = 'Test'; mysql_connect("localhost", "**********", "************") or die(mysql_error()); mysql_select_db("****************") or die(mysql_error()); $order_id = $order-&gt;order_id; $order_user_id = mysql_result(mysql_query("SELECT order_user_id FROM nl7xh_hikashop_order WHERE '".$order_id."' = order_id ;"), 0); $user_email_add = mysql_result(mysql_query("SELECT user_email FROM nl7xh_hikashop_user WHERE '".$order_user_id."' = user_id ;"), 0); $order_shipping_address_id = mysql_result(mysql_query("SELECT user_email FROM nl7xh_hikashop_user WHERE '".$order_user_id."' = user_id ;"), 0); $message = "User ID: $order_user_id Email: $user_email_add;"; //etc mail($email_add, $subject, $message, $headers); } return true; } }

Is using queries a good or bad way to get the field data from multiple tables into my script? Is there an easier way? I guess my main problem is I don't understand how to make use of the $order object properly?

Any help would be marvellous ![:)](/media/kunena/emoticons/8.png ":)")

All the best
Eleventy

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

13 years 2 months ago [\#116812](#116812) by [eleventy](/forum/user/25916-eleventy "View eleventy's Profile")  Replied by *[eleventy](/forum/user/25916-eleventy "View eleventy's Profile")* on topic *[Correct way to pass field data to my script?](/forum/31-development/860573-correct-way-to-pass-field-data-to-my-script#116812 "-- HikaShop version -- : 2.2.0 -- Joomla version -- : 3.1.4 -- PHP version -- : 5.3.27  Hi guys  I am beginning an exciting journey in Hikashop custom plugin development! Yay! B)  I have a basic function like this:  Is using queries a good or bad way to get the field data from multiple tables into my script? Is there an easier way? I guess my main problem is I don't understand how to make use of the $order object properly?  Any help would be marvellous :)  All the best Eleventy")*

I am a NOOOOOOB!

I get it now. I load the class for each table.

Sorry to waste your time. We all need to start somewhere ![:)](/media/kunena/emoticons/8.png ":)")

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

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 2 months ago -  13 years 2 months ago [\#116829](#116829) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Correct way to pass field data to my script?](/forum/31-development/860573-correct-way-to-pass-field-data-to-my-script#116829 "-- HikaShop version -- : 2.2.0 -- Joomla version -- : 3.1.4 -- PHP version -- : 5.3.27  Hi guys  I am beginning an exciting journey in Hikashop custom plugin development! Yay! B)  I have a basic function like this:  Is using queries a good or bad way to get the field data from multiple tables into my script? Is there an easier way? I guess my main problem is I don't understand how to make use of the $order object properly?  Any help would be marvellous :)  All the best Eleventy")*

Gald to see you found the solution!
Enjoy your development and do not hesitate if you have any questions ![;)](/media/kunena/emoticons/11.png ";)")

Last edit: 13 years 2 months ago by [Eliot](/forum/user/1824-eliot "View Eliot's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MDU3My1jb3JyZWN0LXdheS10by1wYXNzLWZpZWxkLWRhdGEtdG8tbXktc2NyaXB0P3RtcGw9bWFya2Rvd24=) 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.123 seconds

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

[](#top)
