Drupal 8 get cart item programmatically
As the top line suggests $purchased_entity is of of type "Drupal\commerce_product\Entity\ProductVariation" which is basically an entity.

All entities have a -&gt;get('field_name') method.

So for your example to get 'field_order_no' you would do

$order_no = $purchased_entity-&gt;get('field_order_no')-&gt;getValue();


You can retrieve the value of any field via the -&gt;getValue() method which returns an array.