How to get products field value from Order Finish Success hooks?

Hi all,

how to get products field value from Order Finish Success hooks?

https://www.modmore.com/simplecart/documentation/frontend/checkout/finished-order-hooks/

// get all ordered products
$products = $order->getMany('Product');
if (!empty($products) && is_array($products)) {
    
    foreach ($products as $product) {
        
        // ??????????
    }
}

$product is a standard xPDO object, scOrderProduct if I’m not mistaken. So you can do $product->toArray() or $product->get(‘fieldname’) to access data from it. The XML schema which defines all fields is available in core/components/simplecart/model/schema/

right! :grin:

Grazie