Skip to content
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

Get error in Custom 1-step Checkout #3

Closed
inelukipg opened this issue Nov 28, 2017 · 11 comments
Closed

Get error in Custom 1-step Checkout #3

inelukipg opened this issue Nov 28, 2017 · 11 comments

Comments

@inelukipg
Copy link

Hi,

I tried this extension with our one step checkout Klarna (https://nordicwebteam.se/magento-2-extensions/klarna-checkout-magento-2.html)
This is an extension that a lot of stores uses in the nordic countries.
It's a free extension, and you can use it with test credentials.

In exception.log file I get:
[2017-11-28 08:28:32] main.ERROR: Magento\Framework\Exception\LocalizedException: Quote was updated, please review it (check shipping amount, products) in /home/smarthem/www/magento2/app/code/NWT/KCO/Model/Checkout.php:582

@tobias-forkel
Copy link
Owner

Hi @inelukipg

What is around app/code/NWT/KCO/Model/Checkout.php line 582 ? Can you please provide more information about the model.

Cheers,
Tobias

@inelukipg
Copy link
Author

Hi,

  $qSign = $this->getQuoteSignature($quote);
        $kSign = $klarnaData['merchant_reference']['signature'];

        if($qSign != $kSign) {
           throw new LocalizedException(__("Quote was updated, please review it (check shipping amount, products)"));
        }

I attached the Checkout.php file.

Checkout.zip

@tobias-forkel
Copy link
Owner

tobias-forkel commented Nov 29, 2017

Hi @inelukipg

The method getQuoteSignature of the extension https://nordicwebteam.se/magento-2-extensions/klarna-checkout-magento-2.html is checking if the quote was manipulated at some point.

I have to manipulate the quote in https://github.com/tobias-forkel/Magento2_CustomShipping/blob/master/Model/Carrier/Custom.php via collectRates otherwise I can't implement a custom shipping method.

So far as I know, this is the only way. Just google for " magento2 collectRates setPrice ". So you may have to get in touch with the guys from nordicwebteam.se to get more information about getQuoteSignature. You can also simply try to fix it by your own by removing the exception.

throw new LocalizedException(__("Quote was updated, please review it (check shipping amount, products)"));

Cheers,
Tobias

@inelukipg
Copy link
Author

Hi @tobias-forkel
Thanks!
Thats what I thought. I'll contact them and see if they can explain why they need to check if the quote was manipulated.
But first I'll try to remove that exeption.

@inelukipg
Copy link
Author

Hi,
Just for info.
If i comment that exeption out I get core error, No shipping method:
main.ERROR: Magento\Framework\Exception\LocalizedException: Please specify a shipping method. in /www/magento2/vendor/magento/module-quote/Model/QuoteValidator.php:55

@inelukipg
Copy link
Author

I'm not sure, but can it have something to do with this?
(I'm using Magento 2.1.8)

Custom Shipping name could be to long?
forkel_customshipping_forkel_customshipping

magento/magento2#5021

@tobias-forkel
Copy link
Owner

Hi @inelukipg

Yeah looks like the shipping method code is too long. I'll test it in 2.1.8 again and change the length if necessary.

I'll keep you posted.

@tobias-forkel
Copy link
Owner

Hi @inelukipg

I wasn't able to reproduce it on a clean 2.1.8 setup. However, I will test it without an underscore, as suggested in magento/magento2#5021

I will keep you posted.

@inelukipg
Copy link
Author

Hi,
Ok thanks!

@inelukipg
Copy link
Author

Hi,
I'm just curious if it was the underscores that caused the error?

@tobias-forkel
Copy link
Owner

tobias-forkel commented Aug 24, 2018

Hi @inelukipg

Please use the latest version ( 1.0.0 ) of https://github.com/magenizr/Magenizr_CustomShipping which is exactly the same code. I have removed the "_" from the shipping method name which supposed to fix the issue. Give it a shot with Magenizr_CustomShipping.

  1. Remove the module composer remove "tobias-forkel/magento2-customshipping" --no-update
  2. You may have to delete the record from table setup_module as well.
  3. Install https://github.com/magenizr/Magenizr_CustomShipping

If you have any questions, feel free to open a new issue there.

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

2 participants