> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://shopdoctors.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Why does the same product get split into two units in the checkout page?

- The splitting happens when the discount amount cannot be equally split per-item. Essentially, we calculate the discounts using the same method that Shopify uses internally, which leads to the following calculation:

**Total discount for # items:**
** Discount per item:**

 When Shopify applies discounts internally, they have the option to apply that discount to the line item. Apps however need to specify the per-item discount, and since we cannot send [per-item discount] to Shopify, we split the items on two lines and then the first line has # qty * [discount per item] = total discount, and the second line has # qty * [discount per item] = total discount, so that when summed, the total discount is still correct: **first line total discount + second line total discount = Total discount for # items**