Source code for shuup.admin.modules.orders.utils

"""
Order utilities and helper classes.
"""


[docs] class OrderInformation: """Helper class for order information display."""
[docs] def __init__(self, order): self._order = order self._provides_info = [] self.title = "Order Information" self._information = ""
[docs] def add_info(self, info_dict): """Add information to the order display.""" self._provides_info.append(info_dict)
[docs] def get_info(self): """Get all order information.""" return self._provides_info
[docs] def provides_info(self): """Check if this instance provides information.""" return bool(self._provides_info)
@property def order(self): """Order ordering for sorting.""" return 0 @property def information(self): """Information content.""" return self._information @information.setter def information(self, value): """Set information content.""" self._information = value