Magento CreditmemoItem returns child items for the products which have variants. However, this child variant item doesn't have line item related information (price, row_total etc.). getPrice() returns 0 for this item and causes zero division exception.
This PR filters out the child items from credit memo line items and sends only parent items. Also, an extra check has been implemented to prevent possible zero divisions.
Description
Magento
CreditmemoItem
returns child items for the products which have variants. However, this child variant item doesn't have line item related information (price, row_total etc.).getPrice()
returns0
for this item and causes zero division exception.This PR filters out the child items from credit memo line items and sends only parent items. Also, an extra check has been implemented to prevent possible zero divisions.
Tested scenarios