Skip to content

Wrong shipping fee in backend with multiple store views #12889

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
tig-dennisvanderhammen opened this issue Dec 27, 2017 · 21 comments
Closed

Wrong shipping fee in backend with multiple store views #12889

tig-dennisvanderhammen opened this issue Dec 27, 2017 · 21 comments
Labels
Event: mm19pl Fixed in 2.2.x The issue has been fixed in 2.2 release line 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

@tig-dennisvanderhammen
Copy link

Preconditions

  1. Magento version 2.2.2 with sample data installed
  2. PHP version 7.0.25
  3. Two different websites with storeviews (explained in steps to reproduce)
  4. Each website a different flat fee (explained in steps to reproduce)

Steps to reproduce

  1. Install a clean version of Magento 2.2.2.
  2. Set up a Second website, second store and second storeview in Stores->All Stores.
  3. Add a product to your Second website at Catalog->Products (in my case the Joust Duffle Bag from the sampledata)
  4. Set up different flat fee shipping fees for both websites in Stores->Configuration->Sales->Shipping Methods (in my case 10$ for flat fee in Main Website, 20$ for flat fee in Second website).
  5. Clear the Magento cache.
  6. Create a new order at Sales->Orders->Create new order.
  7. Click on the button Create New Customer.
  8. Select the Second store view in the Second website.
  9. Add a product and fill in the order details
  10. Click on the button Get shipping methods and rates

Expected result

  1. Expected shipping fee of 20$ is applied, because I selected the second store view when creating the order.

Actual result

  1. The shipping fee of the default website is selected as shown on the screenshot below.
    screen shot 2017-12-27 at 11 07 41

It seems that whenever I change the default website (Stores->All Stores, click on Second Website, select Set as Default and save) I get the shipping fee of the newly selected default store.

Extra screenshots:

Configured websites:
screen shot 2017-12-27 at 11 10 49

Configured flat fee price for Main Website:
screen shot 2017-12-27 at 11 11 45

Configured flat fee price for Second Website:
screen shot 2017-12-27 at 11 12 44

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Dec 27, 2017
@magento-engcom-team
Copy link
Contributor

@tig-dennisvanderhammen, thank you for your report.
We've created internal ticket(s) MAGETWO-86049 to track progress on the issue.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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 Dec 27, 2017
@p-bystritsky p-bystritsky self-assigned this Dec 27, 2017
@okorshenko
Copy link
Contributor

Hi @tig-dennisvanderhammen
the issue has been fixed in 2.2-develop branch

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Mar 19, 2018
@InternetMedicineMan
Copy link

InternetMedicineMan commented Mar 30, 2018

I'm in version 2.2.3 and having this issue. It doesn't appear to be fixed. - edit - Oh I see it's on develop branch so probably next release

@Rickertje
Copy link

I am on 2.2.5 and this is still not solved (be it tablerates in my case)
We are now 6 months after this was labeled 'Fixed in 2.2.x'
Can someone tell me what the status is? Thx.

@Rickertje
Copy link

@magento-engcom-team cab you please answer this question? Thank you.

@callumstar
Copy link

Hi @magento-engcom-team and @okorshenko,

This is still an issue, is there any updates on this please?

@callumstar
Copy link

Hi @tig-dennisvanderhammen,

Did you ever manage to fix this?

@Rickertje
Copy link

My developer tells me that there was an attempt to fix (part of) this in 2.2.5. Anyway it was not fixed for tablerates, I'm not sure about other shipping methods. So there is still work to do on this issue.

@tig-dennisvanderhammen
Copy link
Author

@callumstar, I didn't get any complaints from our clients about this and encountered this during development of an extension. I didn't look into fixing this issue and simply wanted Magento to know about this issue. Sorry!

@Rickertje
Copy link

Ok so where is the big red button to reopen this issue

@jhruehl
Copy link
Contributor

jhruehl commented Sep 21, 2018

Thanks. The fix for this issue now causes the standard shipping rate label to be shown in the language of the store view where the last product was added. (cart and checkout).

I'm going to create a pull request, which sets the QuoteStoreId not as given by the order object, but as given by the store manager. This doesn't mess things up and probably still works for @tig-dennisvanderhammen problem.

jhruehl added a commit that referenced this issue Sep 21, 2018
…not as given by the order itself

Because of the issue #12889 this particalur line was added as a "fix", setting the store id for the quote as given by the quote object itself.
This lead to the standard shipping method's name shown in the cart view totals and shipping rate listing in the checkout to be shown as given by the store view, where the last product was added.
Can be reproduce, if at least two store views, each with a different language and languae specific naming of shipping rates, for one website are given. Add a product in one store view, switch to another language and go the cart view.

This change should still solve the problem described in the issue #12889 and don't mess up the labeling of the shipping rates shown in checkout for websites with multilanguage store views.
jhruehl added a commit that referenced this issue Sep 21, 2018
…not as given by the order itself

requestShippingRates: set quote ID as given by the store manager and not as given by the order itself

### Description

Because of the issue #12889 this particalur line was added as a "fix", setting the store id for the quote as given by the quote object itself.
This lead to the standard shipping method's name shown in the cart view totals and shipping rate listing in the checkout to be shown as given by the store view, where the last product was added.

### Fixed Issues (if relevant)
This change should still solve the problem described in the issue #12889 and don't mess up the labeling of the shipping rates shown in checkout for websites with multilanguage store views.

### Manual testing scenarios
Can be reproduce, if at least two store views, each with a different language and language specific naming of shipping rates, for one website are given. Add a product in one store view, switch to another language and go the checkout/cart view page.
@jhruehl jhruehl reopened this Sep 21, 2018
jhruehl added a commit to jhruehl/magento2 that referenced this issue Sep 21, 2018
requestShippingRates: set quote ID as given by the store manager and not as given by the order itself
Description

Because of the issue magento#12889 this particalur line was added as a "fix", setting the store id for the quote as given by the quote object itself.
This lead to the standard shipping method's name shown in the cart view totals and shipping rate listing in the checkout to be shown as given by the store view, where the last product was added.
Fixed Issues (if relevant)

This change should still solve the problem described in the issue magento#12889 and don't mess up the labeling of the shipping rates shown in checkout for websites with multilanguage store views.
Manual testing scenarios

Can be reproduce, if at least two store views, each with a different language and language specific naming of shipping rates, for one website are given. Add a product in one store view, switch to another language and go the checkout/cart view page.
@jhruehl
Copy link
Contributor

jhruehl commented Sep 21, 2018

It seems I cannot create any pull requests for the 2.2-develop branch even with an updated fork. Only for 2.2 and 2.3-develop. So I leave it there, because the "fix" to this issue still isn't present in the 2.3 branches.

My fix for the "fix" of this issue can be found in the pull requests above, which have been rejected, because they weren't given via a fork.

@Rickertje
Copy link

I'm not sure I understand (but I'm not a developer). While editing an order in admin the store(view) to be used for selecting shipping methods and/or tablerates should be set as the store(view) for which the order was initially created. Also it would be nessecary to have fix become part of 2-2-dev and 2.3.

@jhruehl
Copy link
Contributor

jhruehl commented Sep 24, 2018

@Rickertje Yes. An order should be, but this is about quotes. So the problem isn't that easy to solve I guess. Because the fix was placed somewhere, which has an effect on the frontend, too. We use store views only for different languages. So switching the store view (language) in the frontend can/will cause problems with the current fix.

@Rickertje
Copy link

Hi @jhruehl can you give an update for this issue. Along with maybe the possible duplicates #16604 and #18059 . Thank you.

@jhruehl
Copy link
Contributor

jhruehl commented Oct 24, 2018

@Rickertje I see both cases are valid. The case from this issue and my case. I don't know, if my solution/adjustment given in jhruehl@fed80e2 still solves the issue given here. And I don't have the time to spare to recreate and test the scenario given by the author of the issue with my adjustment.

So we will handle it as we handle most of the bugs, "unconveniant" fixes and changes given by Magento. Creating a core patch, which serves our needs, document it for the next update (with references to exisiting issues) and see if the core patch is still needed or has to be adjusted during the implementation of the next Magento update.

I'd advise your developers to do so in a similar fassion. Saves a lot of time.

Here is a howto for creating patches:
https://docs.gitlab.com/omnibus/development/creating-patches.html
(you should create and apply them in the source folder of the project; we apply them with a different command though)

(Or we throw the problem at the Magento Commerce Support as soon as 2.3 is released officially and let them handle it.)

@deadlyw1re
Copy link

deadlyw1re commented Mar 15, 2019

Why is the shipping price on the website level instead of storeview level?

@krzysztofjasniok
Copy link

#mm19pl

@magento-engcom-team
Copy link
Contributor

@krzysztofjasniok thank you for joining. Please accept team invitation here and self-assign the issue.

@m2-assistant
Copy link

m2-assistant bot commented Sep 15, 2019

Hi @krzysztofjasniok. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


@krzysztofjasniok krzysztofjasniok removed their assignment Sep 15, 2019
@krzysztofjasniok
Copy link

Unable to reproduce on Magento 2.3 with given steps. Tested with flat rate as well as tablerates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: mm19pl Fixed in 2.2.x The issue has been fixed in 2.2 release line 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

10 participants