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

Backport of MAGETWO-59089 for Magento 2.1: Magento 2.1.1 Problem with change currency #9841

Merged
merged 1 commit into from
Jun 7, 2017

Conversation

hostep
Copy link
Contributor

@hostep hostep commented Jun 3, 2017

Description

This problem was discovered in scope of issue #9562
But the fix was already on develop and was fixing another issue: #6746

See the steps below to reproduce the issue we were having which lead me to create this PR.

Since this PR fixes multiple non-related issues, I think you should test this very well. It might even fix other reported issues as well, but it's really hard to tell...

Fixed Issues (if relevant)

  1. Fixes ItemZone on product detail is not set correctly when chaning products via related/upsell products list #9562: ItemZone on product detail is not set correctly when chaning products via related/upsell products list
  2. Fixes Magento 2.1.1 Problem with change currency #6746: Magento 2.1.1 Problem with change currency

Reference to the commit on the develop branch: a9510d3

Manual testing scenarios

  1. Setup a new Magento 2.1.7 installation
  2. Create 2 products: Product1 and Product2, make sure they have a different price and that they are visible on the frontend
  3. Edit Product2 and assign Product1 as an upsell product to it
  4. Reindex and flush caches
  5. Visit Product2 on the frontend and save the generated html: curl --insecure https://mydomain/product2.html > correct.html
  6. Flush the cache again
  7. Visit Product1 on the frontend using a browser, or curl or wget, or whatever, so its data gets cached
  8. Visit Product2 on the frontend and save the generated html: curl --insecure https://mydomain/product2.html > wrong.html
  9. Compare the correct.html against the wrong.html:
$ diff -u correct.html wrong.html
--- correct.html	2017-06-03 13:51:02.000000000 +0200
+++ wrong.html	2017-06-03 13:51:38.000000000 +0200
@@ -622,13 +622,14 @@


 <span class="price-container price-final_price tax weee"
-        >
+         itemprop="offers" itemscope itemtype="http://schema.org/Offer">
         <span  id="product-price-1"                data-price-amount="123"
         data-price-type="finalPrice"
         class="price-wrapper "
-        >
+         itemprop="price">
         <span class="price">€123.00</span>    </span>
-        </span>
+                <meta itemprop="priceCurrency" content="EUR" />
+    </span>

 </div>

The html files should be identical, but they aren't, because price data of Product1 is cached and then being used in the upsell list when visiting Product2.

In our case, this problem is causing some of the Google indexing services to pick the wrong price for Product2, instead it displays the price from Product1 for Product2 in some of its services (like Google adwords), which makes our client and marketeers really nervous as you can imagine :)

… change currency

Fixed issues:

- MAGETWO-59089 [Github]Magento 2.1.1 Problem with change currency magento#6746
(cherry picked from commit a9510d3)
@okorshenko okorshenko self-assigned this Jun 5, 2017
@okorshenko okorshenko added this to the June 2017 milestone Jun 5, 2017
@magento-team magento-team merged commit dd8d0ef into magento:2.1-develop Jun 7, 2017
magento-team pushed a commit that referenced this pull request Jun 7, 2017
magento-team pushed a commit that referenced this pull request Jun 7, 2017
[EngCom] Public Pull Requests - 2.1
 - MAGETWO-69665: Backport of MAGETWO-59089 for Magento 2.1: Magento 2.1.1 Problem with change currency #9841
 - MAGETWO-69543: Fixes regression bug introduced in Magento 2.1.6 where the layered navigation options are sometimes being cached using the wrong store id. #9704
 - MAGETWO-69151: Do not hardcode product link types [2.1 backport] #9601
 - MAGETWO-69691: Travis build failures because the job exceeded the maximum time limit for jobs - 2.1-develop
@magento-team
Copy link
Contributor

@hostep thank you for your contribution

brucemead pushed a commit to VortexCommerce/magento2 that referenced this pull request Dec 20, 2018
…oved as currency wasn't included in cache key, now is added via this plugin https://github.com/VortexCommerce/magento2/blob/23d76ed074d7d5e465cbed782a2831abe192de96/app/code/Magento/Catalog/Block/Category/Plugin/PriceBoxTags.php#L68)

- Increase default cache time to 1 day (86400) this is more that acceptable as the cache key includes the current date so will not load for a new day which could have a new price rule, special price etc...
@brucemead brucemead mentioned this pull request Dec 20, 2018
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants