[Solved] Display product name(s) of an order id
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Display product name(s) of an order id
What else do you want to know?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Display product name(s) of an order id
Well, first, i would like to know where
comes from?
Because that throws an error: "Call to a member function keys() on null"
Thank you!
Code: Select all
$orders
Because that throws an error: "Call to a member function keys() on null"
Thank you!
Re: Display product name(s) of an order id
Sorry, this was a left-over from the first try where the decorator called the method of the inner object. It's removed now in the example.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Display product name(s) of an order id
Excellent - thank you!
Next step: How to access products...
Next step: How to access products...
Last edited by rowild on 20 Jan 2021, 18:49, edited 1 time in total.
Re: Display product name(s) of an order id
Aha, this seems to do it:
Am I on the right track?
Code: Select all
$curr = $orderItem->getBaseItem()->getProducts();
foreach( $curr as $prodId => $product ) {
echo '<pre>';
var_export( $prodId . ': ' . $product->get( 'order.base.product.name' ) );
echo '</pre>';
}
die();
Re: [Solved] Display product name(s) of an order id
Yes. Instead of the "magic" get() method, you should use e.g. getName() to retrieve the product name because the item methods will return default values instead of NULL like get() does. For the list of available methods, have a look at the interface:
https://github.com/aimeos/aimeos-core/b ... /Iface.php
https://github.com/aimeos/aimeos-core/b ... /Iface.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star