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

Payment methods in payments title in wrong language #7582

Closed
Bartlomiejsz opened this issue Nov 28, 2016 · 8 comments
Closed

Payment methods in payments title in wrong language #7582

Bartlomiejsz opened this issue Nov 28, 2016 · 8 comments
Assignees
Labels
bug report Component: Payment Component: Translation Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 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

Comments

@Bartlomiejsz
Copy link
Contributor

Preconditions

  1. Magento 2.1.2
  2. Having at least two store views (e.g. EN and FR)
  3. Payment method configured with different title for each store view (e.g. Invoice - EN, Facture - FR)

Steps to reproduce

  1. Add some product to cart in EN store view.
  2. Go to checkout second step (Payment method title is correct - Invoice).
  3. Switch to FR store view.
  4. Go to second checkout step.

Expected result

  1. Payment method title should now be 'Facture'

Actual result

  1. The title is still 'Invoice', because of those code lines:
public function getAvailableMethods(\Magento\Quote\Api\Data\CartInterface $quote = null)
{
    $store = $quote ? $quote->getStoreId() : null;
    $methods = [];
    foreach ($this->paymentHelper->getStoreMethods($store, $quote) as $method) {
@vityakopin
Copy link

Thanks for reporting this issue. I cannot reproduce this. Try to delete cookies after switching between store views. Could you confirm that this issue is still actual?

@Bartlomiejsz
Copy link
Contributor Author

@vityakopin @veloraven issue still persists on 2.1.7

@vityakopin
Copy link

Internal ticket MAGETWO-70060 was created.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jun 22, 2017
@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Component: Translation Progress: needs update Component: Payment Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

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

@okorshenko okorshenko added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed hacktoberfest labels Sep 23, 2017
@bka
Copy link
Contributor

bka commented Oct 1, 2017

Issue is still present on 2.2-develop. What you can observe is, that the store view from which you put product into the quote matters. If I put a product from other store view e.g. FR into cart and go to checkout the translation will be correct.

It's because the available payment methods and their titles are fetched via API call to /rest/de/V1/carts/mine/payment-information. This API call can only indirectly determine which store view to use. In app/code/Magento/Payment/Model/MethodList.php the storeId to use is coming from the quote.

public function getAvailableMethods(\Magento\Quote\Api\Data\CartInterface $quote = null)
{
    $store = $quote ? $quote->getStoreId() : null;

This quote object gets initialized in and overwritten by Magento/Quote/Model/Quote::loadByCustomer. StoreId is coming from quote in this case.

protected function loadQuote($loadMethod, $loadField, $identifier, array $sharedStoreIds = [])
{
    /** @var Quote $quote */
    $quote = $this->quoteFactory->create();
    if ($sharedStoreIds) {
        $quote->setSharedStoreIds($sharedStoreIds);
    }
    $quote->setStoreId($this->storeManager->getStore()->getId())->$loadMethod($identifier);
    if (!$quote->getId()) {
        throw NoSuchEntityException::singleField($loadField, $identifier);
    }
    return $quote;
}

bka pushed a commit to bka/magento2 that referenced this issue Oct 1, 2017
…d determination precedence to fix payment title translation error in checkout
okorshenko pushed a commit that referenced this issue Oct 11, 2017
… storeId precedence #11165

 - Merge Pull Request #11165 from bka/magento2:issue-7582
 - Merged commits:
   1. 33dcc36
okorshenko pushed a commit that referenced this issue Oct 11, 2017
@okorshenko
Copy link
Contributor

Hi @Bartlomiejsz the issue has been fixed in 2.2-develop branch and will be available in 2.2.1 release soon

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Oct 11, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-80894

@magento-team
Copy link
Contributor

Hi @Bartlomiejsz. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1282 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@magento-team magento-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 25, 2018
magento-engcom-team pushed a commit that referenced this issue Aug 3, 2018
…ite is as on the default website

- reverted fix from community PR #11165
- issue #7582 is fixed via plugin on store view switching
magento-devops-reposync-svc pushed a commit that referenced this issue Apr 28, 2022
CABPI-356: Migration of AdminIms module to magento2ce repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Payment Component: Translation Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 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
Projects
None yet
Development

No branches or pull requests

7 participants