Custom Discount applied to cart not reflecting in order detail of swell dashboard

Hi, We are using our own custom discount logic to apply discounts. We are updating discounts in the cart. discount is successfully applied to the cart and the user paid the discounted price.

On the swell dashboard, cart is showing discount cart URL is https://minoan.swell.store/admin/carts/61d90cfa8e5fd0013d1768d8

but once this same cart is converted to order, the user paid the grand_total (which includes discount) of the cart, which is correct.

but on the order detail of the swell dashboard discount is not mentioned. the total amount is shown on the order also doesn’t include the discount. Order URL is

https://minoan.swell.store/admin/orders/61d90dd5ca8fc7013d8f8d4e

ideally, discounts should be shown on both order detail and cart.

I'm attaching the screenshots on both cart and order created from the same cart.


As you can see in the images, the total on the cart is not equal to the total on order.

Answers

  • even though the discount isn't needed on all of the line items in the cart, I'd still recommend spreading out the total discount on the line items, in order to preserve the existing discount logic.

    Alternatively, if the discount really cannot be set at the item level, you can update the formula for how theΒ discount_totalΒ is calculated, using a custom field of your choosing:

    PUT /:models/carts/fields/discount_total

    {"$set": {Β "formula": "item_discount + custom_discount"Β }}


    Now, when you set the custom_discount field on the cart, it will be included in the discount_total and grand_total calculations, alongside regular discounts.


    Hope this helps!



    I'm using the above solution which was recommended by @Greg in an earlier didiscussion.

    https://community.swell.is/discussion/comment/339

  • Hi Mohit,


    Alex from our team mentioned that he already mentioned through email that we need an improvement for this. He already created an improvement regarding this.

  • Hi Jesse,

    Yes, he said an improvement is needed on this. on the reply to the same email I asked for the ETA for the same. never got any reply on that. we also have to prioritize things according to the same ETA, we can't just wait for an indefinite time.

Sign In or Register to comment.