Skip to main content

How to read something from $order?

More
15 years 7 months ago #6925 by RemoteC
I'm working on a plugin for HikaShop but my problem is that I can't read attributes from $order like the address. Following code is within the 'onAfterOrderCreate(&$order,&$send_email)' function
Code:
$hikaFirstname = $order->billing_address->address_firstname; $hikaLastname = $order->billing_address->address_lastname; $hikaCompany = $order->billing_address->address_company; $hikaFoo = $order->order_user_id; echo "<br />".$hikaFoo; echo "<br />".$hikaFirstname."<br />"; echo "Lastname: ".$hikaLastname."<br />"; echo "Company".$hikaCompany."<br />";
Why is there only a value in $hikaFoo? The other variables are apparently empty. This is probably a PHP syntax error but I've never worked with such heavy arrays and so I apparently don't know how to adress a specific value.

Is there a more comprehensive developer documentation than this one page?

Best regards!

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

More
15 years 7 months ago #6932 by nicolas
You should try $order->cart->billing_address instead of $order->billing_address
More information about that on that thread:
www.hikashop.com/en/support/forum/4-how-...-conflicts.html#5794

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

More
15 years 7 months ago #6949 by RemoteC
Thanks!

I just made a second look in the var_dump($order) and now I see that the billing_adress is included in the cart-object ... just messend around with the braces :-\

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

Time to create page: 0.169 seconds
Powered by Kunena Forum