The mobile (hamburger) version of the menu is displaying on the desktop, how to resolve that?

The mobile (hamburger) version of the menu is displaying on the desktop, how to resolve that?

      Such behavior can be observed if Varnish cache is used. To resolve it, add the following code to sub vcl_hash in the varnish configuration file:
  1. sub vcl_hash {
  2.     if (req.http.X-UA-Device ~ "^mobile" 
  3.         || req.http.X-UA-device ~ "^tablet"
  4.     ) {
  5.         hash_data("mobile");
  6.     } else {
  7.         hash_data("desktop");    
  8.     }
  9. }
      If your instance uses Fastly CDN for caching, some more changes need to be made in addition to this. Add this code to sub vcl_hash:
  1. sub vcl_hash {
  2.     if (req.http.cookie !~ "X-Magento-Vary=") {
  3.         call device_detect;

  4.         if (req.http.X-Amasty-Device) {
  5.             hash_data(req.http.X-Amasty-Device);
  6.         }
  7.     }
  8. }
      And this code to the end of the file default.vcl:
  1. sub device_detect {
  2.     if (req.http.User-Agent ~ "(?i)Mobile"
  3.     || req.http.User-Agent ~ "(?i)Tablet"
  4.     ) {
  5.         set req.http.X-Amasty-Device = "mobile";
  6.     } else {
  7.         set req.http.X-Amasty-Device = "desktop";
  8.     }
  9. }

      Such solutions would only work for the real devices, not the browser resize/mobile emulation tools. In case the issue remains after these changes, don't hesitate to contact our support team to conduct additional investigation.

      • Announcements

      • Already Done in Q2'22

        Brand-new extensions Google Page Speed Optimizer Powered by SpeedSize™ is a synergy of Amasty Google Page Speed Optimizer and SpeedSize, which will help you greatly increase the site performance due to code structure compression and neuroscience media
      • What to expect in Q2'22

        Amasty always strives to deliver new functionality in accordance with the most popular customers’ requests and e-commerce trends. In this article, we'll share our plans on new extensions, improvements, fixes, and other releases the team intends to be
      • March'22 results

        New Solutions In March, the team presented two new suites that combine features of top Amasty extensions and are attractive price-wise: Must-Haves Suite. Don't know how to grow your business or what to start with? Get our must-have set of features for
      • February'22 results

              Time to check the results of February! It's been a tough end to the month, but let's digress a bit and check out what the team has done.       Extensions updates. Besides technical fixes, February was rich in new features and improvements:  Jet
      • January'22 results

              Can't help but start with the biggest news of the past month: Amasty switched to Product Subscriptions. It means that all extensions can now be acquired by subscription only. The initially purchased code of the module is still available in the customer