jgodson / shopify-script-creator

React app to create Shopify Scripts
https://jgodson.github.io/shopify-script-creator/
GNU General Public License v3.0
163 stars 40 forks source link

Bundle pricing issue bug #64

Closed chea1tei closed 2 years ago

chea1tei commented 2 years ago

Hello,

We're setting up a bundle pricing of $199.99 for 2 items. The original price of an item is $109.99. each discount item should be $9.995 if user purchase in a bundle. However on checkout, the script keeps reading it as $20 discounted instead. it should be $19.99 ...

Screenshot 2022-08-04 at 9 57 21 PM
jgodson commented 2 years ago

Hi @chea1tei, thanks for the bug report. What discount are you using for the script, a fixed per item discount of 9.995?

I suspect the problem my lie here

image

When giving it an input of 9.995 like so

image

It would be Money.new(cents: 999.5) which may cause it to round up to 1000 (I'm not 100% sure how that works in scripts internally). You could test that theory by changing that to Money.new(cents: amount) and FixedItemDiscount.new(9995, 'test') for example.

jgodson commented 2 years ago

I was able to verify this today

image