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

Product layout based on attribute_set #36244

Merged
merged 12 commits into from
Feb 17, 2025

Conversation

in-session
Copy link
Contributor

@in-session in-session commented Oct 5, 2022

Currently there is only the possibility to adjust the layout by SKU or by types of the product. In most productive cases, however, this is only partly practical. because it then only refers to many articles or one article. With the integration the layout can be used based on the attribute set similar to an article group, which is more needed in most cases. The display of the articles are controlled in the backend by attribute_set, so there should be a way to pass this to the frontend store as well.

https://developer.adobe.com/commerce/frontend-core/guide/layouts/product-layouts/

LAYOUT FILE DESCRIPTION
catalog_product_view.xml Common layout. Affects all product types
catalog_product_view_type_bundle.xml Layout from this file is applied to bundle product only
catalog_product_view_type_configurable.xml Layout from this file is applied to configurable product only
catalog_product_view_type_downloadable.xml Layout from this file is applied to downloadable product only
catalog_product_view_type_grouped.xml Layout from this file is applied to grouped product only
catalog_product_view_type_simple.xml Layout from this file is applied to simple product only
catalog_product_view_type_virtual.xml Layout from this file is applied to virtual product only
catalog_product_view_id_{id}.xml Layout from this file is applied to the specific product by Entity ID value. E.g. catalog_product_view_id_45.xml
catalog_product_view_attribute_set_{id}.xml Layout from this file is applied to the specific product attribute set by Entity ID value. E.g. catalog_product_view_attribute_set_45.xml
catalog_product_view_sku_{sku}.xml Layout from this file is applied to the specific product by SKU value. E.g. catalog_product_view_sku_24-WG080.xml

Example: catalog_product_view_attribute_set_15.xml
Controls the front-end display of all items that are within the Bags group.

Resolved issues:

  1. resolves [Issue] Product layout based on attribute_set #38790: Product layout based on attribute_set

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@in-session
Copy link
Contributor Author

@magento run all tests

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@m2-assistant
Copy link

m2-assistant bot commented Oct 5, 2022

Hi @in-session. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@in-session
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

1 similar comment
@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@in-session
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@sdzhepa sdzhepa added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Oct 6, 2022
@in-session
Copy link
Contributor Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @in-session. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

Hi @in-session, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

@in-session
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@in-session
Copy link
Contributor Author

@magento run Functional Tests B2B,Functional Tests CE,Functional Tests EE,Static Tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@in-session
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@in-session
Copy link
Contributor Author

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@sinhaparul sinhaparul added the Project: Community Picked PRs upvoted by the community label May 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel engcom-Hotel self-requested a review May 31, 2024 07:45
@engcom-November
Copy link
Contributor

As the linked issue is marked as feature request, moving the PR to On hold till we get PO confirmation.

Thank you.

@MaximGns
Copy link

MaximGns commented Jul 16, 2024

Can this field be configurable? As the existing layout handle for sku/id based is already increasing the load on the layout cache...

Please see: #102 (comment)
This change can only cause it to increase it even further...

@toonvd
Copy link

toonvd commented Aug 2, 2024

RIP cache performance. This and the sku/id layout handle should indeed be off by default and have a field in sysconfig to activate it.

@engcom-Charlie
Copy link
Contributor

As we got the confirmation from Product Owner on this feature request issue, moving it back to Extended testing.

As the linked issue is marked as feature request, moving the PR to On hold till we get PO confirmation.

Thank you.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@engcom-Charlie
Copy link
Contributor

@magento run all tests

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@engcom-Dash
Copy link
Contributor

@magento run all tests

@engcom-Dash
Copy link
Contributor

@magento run Functional Tests EE, Functional Tests B2B

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 17f6230 into magento:2.4-develop Feb 17, 2025
10 of 12 checks passed
@hostep
Copy link
Contributor

hostep commented Feb 17, 2025

@engcom-Charlie or @engcom-Dash: have these 2 comments been taken into consideration and/or have been verified if true?

If this change causes caching storage to increase significantly, it may not have been a good idea to merge it, unless there is an easy way to disable this.

@IvanChepurnyi
Copy link
Contributor

There is definitely going to be a lot of issues in future for Redis cache being blown up, unless we completely change Magento Layout building mechanism like I did before for Magento 1 (compile layouts handles into own files and then include them)

@toonvd
Copy link

toonvd commented Feb 20, 2025

@engcom-Charlie @engcom-Dash agencies are even implementing fixes to be able to disable the handles. Please reconsider this.

https://github.com/Vendic/module-optimize-cache-size/tree/main

@engcom-Charlie
Copy link
Contributor

Hi @in-session,

Thank you for the contribution!

@hostep @toonvd @IvanChepurnyi @MaximGns thank you for providing your valuable thoughts on this. I have gone through all the comments about making this change as a configurable one. As this PR is already merged, requesting the community to raise a Pull Request to address this new change. We will see to take it further as per the process.

@in-session
Copy link
Contributor Author

in-session commented Mar 7, 2025

@engcom-Charlie after some consideration I think the catalog_product_view_attribute_set_{id}.xml would certainly be used more than the catalog_product_view_id_{id}.xml. Still, in terms of feedback, it wouldn't be a bad idea to make it an optional future. I have therefore made another PR, which makes it possible to activate or deactivate this, as well as the layout of the products id.

@hostep @toonvd @IvanChepurnyi @MaximGns - FYI
#39718

@engcom-Charlie
Copy link
Contributor

Thank you @in-session.

Thank you for raising a new Pull Request to take care of this new configuration feature.

We will take #39718 PR further as per our regular process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Project: Community Picked PRs upvoted by the community Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Recently Merged
Development

Successfully merging this pull request may close these issues.

[Issue] Product layout based on attribute_set