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

#   Can't get products array from fullOrder

##

- **[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 [\#117294](#117294) by [eleventy](/forum/user/25916-eleventy "View eleventy's Profile")  *[Can't get products array from fullOrder](/forum/31-development/860698-cant-get-products-array-from-fullorder#117294 "Hi guys,  Would you mind having a look at this for me?  I'm loading the full order, so that I can access shipping address, product etc. But I can't seem to get the products array.  What I intend to do is add more code which will create an invoice and customer in Kashflow, hence the //create variables  I've also tried to access the product information like this:  and then:  But the message is blank.  Probably something silly, apologies if so :unsure:  Many thanks Eleventy")* was created by *[eleventy](/forum/user/25916-eleventy "View eleventy's Profile")*

Hi guys,

Would you mind having a look at this for me?

I'm loading the full order, so that I can access shipping address, product etc. But I can't seem to get the products array.

What I intend to do is add more code which will create an invoice and customer in Kashflow, hence the //create variables
Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php if(!@include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')){ return false; } 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)){ $orderClass = hikashop_get('class.order'); $full_order = $orderClass-&gt;loadFullOrder($order-&gt;order_id, true, false); //create variables $email = $send_email; $cart = $full_order-&gt;products-&gt;order_product_name; $inv_name = $full_order-&gt;shipping_address-&gt;address_firstname . " " . $full_order-&gt;shipping_address-&gt;address_lastname; $inv_addr1 = $full_order-&gt;shipping_address-&gt;address_street; $inv_addr2 = $full_order-&gt;shipping_address-&gt;address_city; $inv_state = $full_order-&gt;shipping_address-&gt;address_state; $inv_zip = $full_order-&gt;shipping_address-&gt;address_post_code; $inv_country = $full_order-&gt;shipping_address-&gt;address_country; $description = $cart; $qty = '1'; $subtotal = $full_order-&gt;products-&gt;order_product_price; $tax_rate = 20; $tel = $full_order-&gt;shipping_address-&gt;address_telephone; $shipping = $full_order-&gt;shipping-&gt;shipping_price; //email $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'; $message = $full_order-&gt;products-&gt;order_product_name; mail($email_add, $subject, $message, $headers); } return true; } } ?&gt;

I've also tried to access the product information like this:
Code:

$productClass = hikashop_get('class.product'); $full_product = $productClass-&gt;getProducts( $this-&gt;element-&gt;product_id );

and then:
Code:

$message = $full_product-&gt;product_name;

But the message is blank.

Probably something silly, apologies if so ![:unsure:](/media/kunena/emoticons/22.png ":unsure:")

Many thanks
Eleventy

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MDY5OC1jYW50LWdldC1wcm9kdWN0cy1hcnJheS1mcm9tLWZ1bGxvcmRlcj90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86315
- Thank you received: 14276
-
-

13 years 2 months ago [\#117296](#117296) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Can't get products array from fullOrder](/forum/31-development/860698-cant-get-products-array-from-fullorder#117296 "Hi guys,  Would you mind having a look at this for me?  I'm loading the full order, so that I can access shipping address, product etc. But I can't seem to get the products array.  What I intend to do is add more code which will create an invoice and customer in Kashflow, hence the //create variables  I've also tried to access the product information like this:  and then:  But the message is blank.  Probably something silly, apologies if so :unsure:  Many thanks Eleventy")*

$full_order-&gt;products is an array of products.
So you can't do:
$cart = $full_order-&gt;products-&gt;order_product_name;

You should do:
foreach($full_order-&gt;products as $product){
$cart = $product-&gt;order_product_name;
}

The following user(s) said Thank You: [eleventy](/forum/user/25916-eleventy "View eleventy's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MDY5OC1jYW50LWdldC1wcm9kdWN0cy1hcnJheS1mcm9tLWZ1bGxvcmRlcj90bXBsPW1hcmtkb3du) 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 [\#117301](#117301) by [eleventy](/forum/user/25916-eleventy "View eleventy's Profile")  Replied by *[eleventy](/forum/user/25916-eleventy "View eleventy's Profile")* on topic *[Can't get products array from fullOrder](/forum/31-development/860698-cant-get-products-array-from-fullorder#117301 "Hi guys,  Would you mind having a look at this for me?  I'm loading the full order, so that I can access shipping address, product etc. But I can't seem to get the products array.  What I intend to do is add more code which will create an invoice and customer in Kashflow, hence the //create variables  I've also tried to access the product information like this:  and then:  But the message is blank.  Probably something silly, apologies if so :unsure:  Many thanks Eleventy")*

Hi Nicolas, thanks very much ![:)](/media/kunena/emoticons/8.png ":)")

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

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

[](#top)
