Comments

Lukas von Blarer created an issue. See original summary.

luksak’s picture

Issue summary: View changes
ytsurk’s picture

We need our own cache context here.

ytsurk’s picture

Status: Active » Needs review
StatusFileSize
new3.59 KB
luksak’s picture

Here is this patch combined with #2895850: Implement automatic currency conversion based on set exchange rate instead of fixed price fields in comment #4 in case anyone needs it.

luksak’s picture

StatusFileSize
new25.06 KB

Something went wrong with the last patch. This one should work.

luksak’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #4 works perfectly. RTBC!

mglaman’s picture

+++ b/commerce_currency_switcher.module
@@ -0,0 +1,16 @@
+  if (array_key_exists('#commerce_product', $build) ||
+      array_key_exists('#commerce_product_variation', $build)) {
+  	// Add our cache context.
...
+    /*if (array_key_exists('variations', $build)) {
...
+    }*/

Why not just !empty($build[''])?

Tab not space.

Commented code.

ytsurk’s picture

StatusFileSize
new10.17 KB

.

ytsurk’s picture

StatusFileSize
new14.17 KB

Struggling with my texteditor .. sorry ..

ytsurk’s picture

StatusFileSize
new3.59 KB

so here we go ..

ytsurk’s picture

StatusFileSize
new7.34 KB

and finally ..

ytsurk’s picture

StatusFileSize
new3.43 KB

no more comments

ytsurk’s picture

StatusFileSize
new3.44 KB

it starts getting scary

But here's the updated patch. Thank you for your suggestions.
As I don't like double negations, I left the array_key_exists.

mglaman’s picture

+1

Side note for another issue: Using the session returned from the request is not as stable as using the normal session service. We experienced a lot of bugs when using this approach.

ytsurk’s picture

Join the discussion about the storage here #2914898: Store user's currency in a cookie instead of a session

luksak’s picture

About to post a patch in that issue. Let's get this one committed since the other issue depends in this one.

sumanthkumarc’s picture

Last patch doesn't apply cleanly on latest head, so tweaking and committing.

  • sumanthkumarc committed 76e19a4 on 8.x-1.x authored by ytsurk
    Issue #2914911 by ytsurk, Lukas von Blarer, mglaman, sumanthkumarc:...
sumanthkumarc’s picture

Status: Reviewed & tested by the community » Fixed

Committed and Thanks @matt, @lukas and @ytsurk.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.