lsretailomni / lsmag-two

LS Ecommerce - Magento, an ecommerce interface for integrating Magento with LS Central.
https://www.lsretail.com/
10 stars 16 forks source link

Discount missing in totals checkout/mails #57

Closed xcom-magento closed 3 months ago

xcom-magento commented 3 months ago

In the latest version of the LsRetail Magento module (2.7.0) the discount is missing in the totals view in the checkout and in the sales mails. We've found this commit where some logic is removed that applied the discountAmount to the quote item. The new totals breakdown doesn't make sense for a customer because they can't see how the order total is build up. This also applies to the sales mails.

Preconditions (*)

  1. Magento version: 2.4.7
  2. LS Ecommerce Magento version: 2.7.0
  3. LS Commerce version: 2024.4.1
  4. LS Central version: 22.0.19.1004556 (23.1.16.587 [17599])
  5. LS Retail partner: TCOG

Steps to reproduce (*)

  1. Add a product to the cart that has a discount in LS.
  2. Go to the checkout and check the totals.

Expected result (*)

  1. The applied discount is visible in the totals overview. Screenshot below is from production environment with older version of the LsRetail module lsretail_correct

Actual result (*)

  1. The applied discount isn't visible anymore since the latest version. lsretail_wrong
umarusaf902 commented 3 months ago

Hi @xcom-magento, thanks for reporting the issue. We are looking into it. In the mean time can you confirm if this discount is a discount offer, mix and match offer or a coupon offer ?

xcom-magento commented 3 months ago

Hi @umarusaf902, the OneListCalculate response is:

<a:OrderDiscountLine>
    <Id xmlns="http://lsretail.com/LSOmniService/Base/2017"/>
    <a:Description>van 325,00 voor 229,00</a:Description>
    <a:DiscountAmount>96.00</a:DiscountAmount>
    <a:DiscountPercent>29.54</a:DiscountPercent>
    <a:DiscountType>PeriodicDisc</a:DiscountType>
    <a:LineNumber>10000</a:LineNumber>
    <a:No>10000</a:No>
    <a:OfferNumber>PR-0025</a:OfferNumber>
    <a:OrderId/>
    <a:PeriodicDiscGroup>PR-0025</a:PeriodicDiscGroup>
    <a:PeriodicDiscType>DiscOffer</a:PeriodicDiscType>
</a:OrderDiscountLine>

The PeriodDiscType is DiscOffer, so i think a discount offer.

umarusaf902 commented 3 months ago

Hi @xcom-magento, thanks for providing more details. FYI, we have managed to fix the issue and the code has already made its way into master branch and it will be available in the next release.