So thankful for all the help on here, but still so baffled as to how Im not able to just quickly determine how to pull these values out of certain arrays and objects.
Trying to get the order id (and other values) from the frickin $variables array in hook_preprocess_hook
Code afc.theme
function afc_preprocess_commerce_order_receipt(&$variables) {
dpm($variables['order_entity']);
\Drupal::logger('afc_theme')->notice('running');
}
Some of the Output
stdClass Object
(
[__CLASS__] => Drupal\commerce_order\Entity\Order
[values:protected] => Array
(
[order_id] => Array
(
[x-default] => 182
)
[type] => Array
(
[x-default] => default
)
[uuid] => Array
(
[x-default] => c8b1c210-0e6e-4efb-a59d-84b28d4dadfe
)
[order_number] => Array
(
[x-default] =>
)
[store_id] => Array
(
[x-default] => 1
)
[uid] => Array
(
[x-default] => Array
(
[0] => Array
(
[target_id] => 1
)
)
)
Ive tried various wrong things like:
$variables['order_entity'] = $order;
dpm($order->get("order_id")->getValue());
dpm($variables->get("order_id")->getValue());
dpm($variables['order_entity']['order_id'];
1. How do I get the order_id from this $variables object?
2. How/where did you find this information telling you how to get this value out?