definition_id this- get_definition_id if empty definition_id definitio

1
2
3
4
5
6
7
$definition_id = $this->get_definition_id();
if (!empty($definition_id)) {
$definition_item = parent::init($this->getAssignedId('item', 'definition'));
if (!empty($definition_item) && $definition_item->has_discount && empty($discount)) {
$discount = $definition_item->discount;
}
}