Skip to content

Error getting rates when using JPY and MXN currencies when applying coupon #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
VictorSoaresRedstage opened this issue Mar 1, 2023 · 7 comments

Comments

@VictorSoaresRedstage
Copy link

VictorSoaresRedstage commented Mar 1, 2023

Hello,

On cart/checkout, when getting shipping rates, if I'm using JPY or MXN currency and apply a coupon code, I receive a message "No Valid Rates found for Carrier". If I removes coupon, it works.

Current version: "20.51.6"

Error is returning from ShipperHQ API:
"error":{
"errorCode":508,
"internalErrorMessage":"No Valid Rates found for Carrier",
"externalErrorMessage":null,
"priority":999
},

I think there's some issue when calculating discount to send to ShipperHQ. Check "discountedStorePrice" and "discountedTaxInclStorePrice" fields (they are negatives):

MXN request:
"qty":1,
"weight":"2.600000",
"rowTotal":3965.61,
"basePrice":199.99,
"storePrice":199.99,
"taxInclBasePrice":199.99,
"taxInclStorePrice":3965.61,
"baseRowTotal":199.99,
"discountPercent":10,
"discountedBasePrice":179.99,
"discountedStorePrice":-196.57,
"discountedTaxInclBasePrice":179.99,
"discountedTaxInclStorePrice":-196.57,
"fixedPrice":false,
"fixedWeight":false,
"discountAmount":396.56,
"attributes":[],
"baseCurrency":"USD",
"packageCurrency":"MXN",
"storeBaseCurrency":"USD",
"storeCurrentCurrency":"MXN",
"taxPercentage":0,
"freeShipping":false,
"type":"simple"

JPY request:
"qty":1,
"weight":"2.600000",
"rowTotal":29274.93,
"basePrice":199.99,
"storePrice":199.99,
"taxInclBasePrice":199.99,
"taxInclStorePrice":29274.93,
"baseRowTotal":199.99,
"discountPercent":10,
"discountedBasePrice":179.99,
"discountedStorePrice":-2727.5,
"discountedTaxInclBasePrice":179.99,
"discountedTaxInclStorePrice":-2727.5,
"fixedPrice":false,
"fixedWeight":false,
"discountAmount":2927.49,
"attributes":[],
"baseCurrency":"USD",
"packageCurrency":"JPY",
"storeBaseCurrency":"USD",
"storeCurrentCurrency":"JPY",
"taxPercentage":0,
"freeShipping":false,
"type":"simple",

USD request (working fine):
"qty":1,
"weight":"2.600000",
"rowTotal":199.99,
"basePrice":199.99,
"storePrice":199.99,
"taxInclBasePrice":199.99,
"taxInclStorePrice":199.99,
"baseRowTotal":199.99,
"discountPercent":10,
"discountedBasePrice":179.99,
"discountedStorePrice":179.99,
"discountedTaxInclBasePrice":179.99,
"discountedTaxInclStorePrice":179.99,
"fixedPrice":false,
"fixedWeight":false,
"discountAmount":20,
"attributes":[],
"baseCurrency":"USD",
"packageCurrency":"USD",
"storeBaseCurrency":"USD",
"storeCurrentCurrency":"USD",
"taxPercentage":0,
"freeShipping":false,
"type":"simple",

Used same product and coupon (10% discount).

Thanks.

@WSAlewis
Copy link

Hello @VictorSoaresRedstage,

Just updating here for visibility as we've conversed through email, our development team are looking into this and we'll reach out once we have further information to share.

Thank you for raising this.

Lewis Kennedy - ShipperHQ Support.

@wsajosh
Copy link
Contributor

wsajosh commented Apr 12, 2023

Hi @VictorSoaresRedstage Thanks for raising this. I'm the developer looking into the issue. It's stemming from a bug in the core Magento code it would seem. The call to $item->getPrice() used to return the store price in the current currency, indeed the PHPDocs say that's what it should do but it's not. I'm going to add a function to the ShipperHQ code to calculate that value instead to work around this issue. I'm hoping that we should have a new release by early next week to address this. Thanks for raising the issue

@VictorSoaresRedstage
Copy link
Author

VictorSoaresRedstage commented Apr 12, 2023 via email

@VictorSoaresRedstage
Copy link
Author

Hi @wsajosh, any updates on this issue?

Thanks,
Victor.

@wsajosh
Copy link
Contributor

wsajosh commented Apr 26, 2023

Hi @VictorSoaresRedstage

Yes, sorry for the delay. This is still in QA. I'll chase it up.

@wsajosh
Copy link
Contributor

wsajosh commented Apr 26, 2023

Hi @VictorSoaresRedstage I've just released 20.52.1 which should address this issue. Thanks for raising it and patience while we resolved it.

@wsajosh wsajosh closed this as completed Apr 26, 2023
@VictorSoaresRedstage
Copy link
Author

@wsajason Thanks!! I'll test and let you know any issues.

Thank you,
Victor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants