magento2: Magento v2.3 - Choosing a child theme for product .. layout xml doesn't work nor does the layout update

Preconditions (*)

  1. Magento 2.3.x & 2.4-develop
  2. PHP 7.2

Steps to reproduce (*)

When you apply ThemeC on a product, then only the (extended) layout of ThemeB will be taken in the following scenario:

VendorA
  |__/ThemeA (parent: Magento/blank)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml

VendorB
  |__/ThemeB (parent: VendorA/ThemeA; applied theme for store)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml
  |__/ThemeC (parent: VendorB/ThemeB)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml

I don’t know if there is any difference when all themes are by the same vendor, but at least this is my setup. Even tough above setup describes extending layouts I’ve also tried to override the layout with the same effect.

Expected result Magento pulls the “catalog_product_view.xml” from the child theme(theme C).

Actual result Magento pulls the “catalog_product_view.xml” from the theme B.


Additional information Currently I have fixed the issue with this patch provided by kirmorozov.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Hello @engcom-Hotel

I have to disagree with you and in my opinion this is still a valid issue - reproduced on my side on 2.2.x and 2.3.x

When you apply ThemeC on a product, then only the (extended) layout of ThemeB will be taken in the following scenario:

VendorA
  |__/ThemeA (parent: Magento/blank)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml

VendorB
  |__/ThemeB (parent: VendorA/ThemeA; applied theme for store)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml
  |__/ThemeC (parent: VendorB/ThemeB)
    |__/Magento_Catalog
      |__/layout
        |--catalog_product_view.xml

I don’t know if there is any difference when all themes are by the same vendor, but at least this is my setup. Even tough above setup describes extending layouts I’ve also tried to override the layout with the same effect.

Currently I have fixed the issue with this patch provided by kirmorozov.

The bug is stil existing on 2.4.2 😦

Hi @omaxmo the default/applied theme is (and should be) ThemeB - however the theme on some products should be ThemeC.

https://docs.magento.com/user-guide/catalog/settings-advanced-design.html https://docs.magento.com/user-guide/catalog/product-scheduled-design-update.html