- Posts: 28
- Thank you received: 0
How to read something from $order?
15 years 7 months ago #6925
by RemoteC
How to read something from $order? was created 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
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!
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 />";
Is there a more comprehensive developer documentation than this one page?
Best regards!
Please Log in or Create an account to join the conversation.
15 years 7 months ago #6932
by nicolas
Replied by nicolas on topic Re: How to read something from $order?
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
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.
15 years 7 months ago #6949
by RemoteC
Replied by RemoteC on topic Re: How to read something from $order?
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
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