Skip to content

User agent exception not setting the correct templates for product pages. #16074

@drew7721

Description

@drew7721

Preconditions

  1. Magento 2.2.4
  2. PHP 7.1.17
  3. Redis 3.2.11
  4. Mysql Ver 14.14 Distrib 5.6.39-83.1

Steps to reproduce

  1. Create a parent theme ex: parent (extending or not the blank theme)
  2. Create a child theme of parent for the desktop version ex: desktop
  3. Create another child theme of parent for mobile devices ex: mobile
  4. In all themes, create the Magento_Theme/templates/html/footer.phtml file with different content.
  5. In the Admin section Content -> Design -> Configuration edit the Global Scope and set the desktop theme as default. Click Add New User Agent Rule button and add an exception for /(iPhone|iPod|iPad|Android)/i to use the mobile theme.
  6. In a browser visit the site with "Responsive Design Mode" enabled and change the user agent to one one of the above. Note that the categories pages, listings and CMS pages are working fine.
  7. Visit a product page. Note that the desktop footer is loading regardless of the user agent.

Expected result

What I find strange is that some templates are loading fine. For instance the header.phtml header will load proper one form the mobile theme based on the user agent but not the footer.phtml or the absolute_footer.phtml.

Actual result

  1. The footer.phtml and absolute_footer.phtml templates are loading from the desktop theme instead of the mobile theme regardless of the user agent.

###Notes
For me, this has broken after upgrading to 2.2.4, on 2.1.10 it was working fine and it was loading the proper templates based on the user agent.

Metadata

Metadata

Assignees

Labels

Component: ThemeFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions