Skip to content

Table rate shipment is taken from wrong website ID when creating an order through the admin #16604

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
digikeijs opened this issue Jul 6, 2018 · 32 comments
Labels
Component: Sales help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@digikeijs
Copy link

digikeijs commented Jul 6, 2018

Summary of the issue

When I create an order through the admin panel and select my shipping method table rate it takes the shipping rate table from the wrong website ID.

Preconditions

magento 2.2.4, Linux, non sample data

Steps to reproduce

  1. Setup multistore
  2. Setup different table rates per website
  3. Then through the admin create a new order for the second website/store
  4. Select your shipping method and the price will be taken from the first website / store (id1)

Expected result

Table rate prices are taken from the correct website id

Actual result

Shipment price is always taken from the table rate website id 1

@magento-engcom-team
Copy link
Contributor

Hi @digikeijs. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@digikeijs do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Jul 6, 2018
@digikeijs
Copy link
Author

@magento-engcom-team give me 2.2.4 instance

@magento-engcom-team
Copy link
Contributor

Hi @digikeijs. Thank you for your request. I'm working on Magento 2.2.4 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @digikeijs, here is your Magento instance.
Admin access: https://i-16604-2-2-4.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@engcom-backlog-nickolas engcom-backlog-nickolas added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Sales Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 9, 2018
@engcom-backlog-nickolas engcom-backlog-nickolas removed their assignment Jul 9, 2018
@engcom-backlog-nickolas
Copy link

Hello @digikeijs, thank you for your report.
We've acknowledged the issue and added to our backlog.

@digikeijs
Copy link
Author

Thanks a lot, if you have time can you please also look at below issue. Almost the same issue but then related to update qty but also using the wrong website id / store.

#15846

@CliftonWLS
Copy link

We are having the same issue. Tracked it down to the requestShippingRates() method in \Quote\Model\Quote\Address.php:

$request->setStoreId($this->storeManager->getStore()->getId());
$request->setWebsiteId($this->storeManager->getWebsite()->getId());

Where storeManager is not set with the store that was selected when creating the order. I have tried to override this method but have run into endless issues doing so. Is there anyone that can provide some insight into overriding this method?

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Jul 19, 2018
@callumstar
Copy link

Hi @digikeijs,

Did you ever resolve this at all?

@callumstar
Copy link

Hi @CliftonWLS,

Did you ever manage to succeed in overriding the method at all?

@SvanZui
Copy link

SvanZui commented Sep 14, 2018

@callumstar nope still waiting on the magento team to fix it. Do have a workaround but it sucks

@callumstar
Copy link

Hi @SAPontwerp,

Are you able to share the workaround at all with me please? If it's something then I'd be happy to use it!

@callumstar
Copy link

Hi @SAPontwerp, did you have a workaround at all? I'm happy to use it no matter how hacky it is.

@SvanZui
Copy link

SvanZui commented Sep 19, 2018

@callumstar we do not have that much orders from the admin so we just enable a fixed shipping price when we add an order and turn it off again when done.

@Rickertje
Copy link

@magento-engcom-team hi guys any idea when this gets fixed (along with maybe #18059 and #12889 and #16604 which are possible duplicates) ?

@Rickertje
Copy link

Hi guys it has been another month. Can someone give an update?

@oleksii-lisovyi
Copy link

Hi guys.

Looks like the issue has been fixed in the 2.2-develop branch.
Related commit:
9c066ca

@Rickertje
Copy link

@oleksii-lisovyi does this mean that this fix will also (by default) be incorporated in 2.3 (and or 2.2.7) ? I'm not a developer so I dont know exactly how this works.

@oleksii-lisovyi
Copy link

@Rickertje, yes. Having any fix in the develop branch means, that it will be available in one of the next 2.2.x releases and could be ported into 2.3.

@oleksii-lisovyi
Copy link

I tested the fix I've mentioned previously - it works great. I'm closing the issue.

@Rickertje
Copy link

@oleksii-lisovyi I have tried this in 2.2.7 but the problem is still there. Please reopen the issue.

@oleksii-lisovyi
Copy link

oleksii-lisovyi commented Jan 4, 2019

@Rickertje, the issue was not fixed in 2.2.7 (probably it will be fixed in the 2.2.8).

But you can apply the fix right now by applying patch via vaimo/composer-patches.

How to apply specific commit/PR from terminal:
0. Install composer by following steps from https://getcomposer.org/download/. After make composer global:

mv composer.phar /usr/local/bin/composer
  1. Install package vaimo/composer-patches:
cd path/to/magento2 && composer require vaimo/composer-patches:4.7.0
  1. Add following section into path/to/magento2/composer.json file:
...
"extra": {
        "magento-force": "override",
        "patches": {
           "magento/module-quote": {
                "Fix issue getting rates while placing order from Admin panel": {
                    "source": "https://github.com/magento/magento2/commit/9c066ca1cc2f2db9e66575da25992ca9bb74f65a.patch",
                    "level": 5
                }
            }
        }
    },
...
  1. Apply patches:
composer install

@digikeijs
Copy link
Author

digikeijs commented Mar 7, 2019

Anybody got this working on 2.3? When I want to install this patch I get

 - Applying patches for magento/module-quote (1)
    ~ digikeijs/magento2: https://github.com/magento/magento2/commit/9c066ca1cc2f2db9e66575da25992ca9bb74f65a.patch [NEW]
      Fix issue getting rates while placing order from Admin panel
  [Vaimo\ComposerPatches\Exceptions\PatchFailureException]
  Cannot apply patch /tmp/composer-patches-e54b6815eedfac36ce8b5e9e0554cb6b.patch

@oleksii-lisovyi
Copy link

Hi, @digikeijs.

The issue is fixed in the 2.3-develop in the commit cc00197.
You can try to apply this commit instead of that one, that is related to 2.2.x.

@digikeijs
Copy link
Author

Well it's not fixed in 2.3 but found a solution already but will also check your info thanks

@oleksii-lisovyi
Copy link

@digikeijs, 2.3 is a stable version, but 2.3-develop is a development branch, than usually contains more fixes and improvements comparing to the branch of stable version.
Just try to apply that patch - the fix looks the same as on 2.2.

@digikeijs
Copy link
Author

Sorry you are right, misread that :-)

@digikeijs
Copy link
Author

Same problem :-( Processing patches configuration

- Applying patches for magento/module-quote (1)
  ~ digikeijs/magento2: https://github.com/magento/magento2/commit/cc00197d13d6244e32201e4c6bf00287e54747c5.diff [NEW]
    Fix issue getting rates while placing order from Admin panel


[Vaimo\ComposerPatches\Exceptions\PatchFailureException]
Cannot apply patch /tmp/composer-patches-09ece90d8e75d0f6997d6a89f04100b4.patch


@oleksii-lisovyi
Copy link

There is one more additional commit, that was done before that change.
Please add a patch for the commit b35b681 as well.
This should help.

@digikeijs
Copy link
Author

digikeijs commented Mar 8, 2019

Sorry for all the questions, can you help me running multiple patches? Like this it does not work

"extra": {
        "magento-force": "override",
		"patches": {
           "magento/module-quote": {
                "Fix issue getting rates while placing order from Admin panel": {
				    "source": "https://github.com/magento/magento2/commit/b35b68130265163f2ed151ff94e0d9f7fc63d44c.patch",
                    "source": "https://github.com/magento/magento2/commit/cc00197d13d6244e32201e4c6bf00287e54747c5.patch"
                }

@oleksii-lisovyi
Copy link

No problem. Each patch must contain 1 source. So adding 2 patches for 1 module requires to have following structure:

"extra": {
        "magento-force": "override",
		"patches": {
           "magento/module-quote": {
                "Fix issue getting rates while placing order from Admin panel - part 1": {
				    "source": "https://github.com/magento/magento2/commit/b35b68130265163f2ed151ff94e0d9f7fc63d44c.patch"
                },
"Fix issue getting rates while placing order from Admin panel - part 2": {
				    "source": "https://github.com/magento/magento2/commit/cc00197d13d6244e32201e4c6bf00287e54747c5.patch"
                }
}

Please check on typos, because I'm writing from phone.

@oleksii-lisovyi
Copy link

Hi, @digikeijs.

Did it help? Do you need a help?

@digikeijs
Copy link
Author

digikeijs commented Mar 11, 2019

Thanks for the follow up. No already the first commit gives issues, most likely the content of the file is a bit different. But I like my workaround more, no more patch files, I just replace the files I want to have replaced during composer install. Saves a lot of hassel

		"scripts": {
		"post-install-cmd": [
				"cp -Rfp vendor-patches/. ."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Sales help wanted Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

8 participants