Shop_OrderStatus
The Shop_OrderStatus class represents a status of an order. You can access an object of this class through the $status field of the Shop_Order class.
Parent class: Db_ActiveRecord
Class fields
- $code – status API code
- $name – status name
- $color – status color in HEX format (#9acd32). You can use this field to customize the order list on the Customer Orders page.
Usually you don't need to access the order status field directly. The Shop_Order class has hidden status fields which can be accessed through the displayField method of the order object. It is preferable to use the hidden order fields instead of accessing the $status field directly from the database usage efficiency point of view. There are 2 status-related fields which you can request from the order object:
- status – corresponds the status $name field
- status_color – corresponds the status $color field
The example of using the order status fields:
Order status:
<span style="color: <?= $order->displayField('status_color') ?>">
<?= $order->displayField('status') ?>
</span>See also:
Next: Shop_PaymentMethod
Previous: Shop_OrderItem
Return to Reference

