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

[BUG] Impossible to override SwXXX components (?) #354

Closed
1 task done
bounoable opened this issue Aug 3, 2023 · 3 comments · Fixed by #357 or #1501
Closed
1 task done

[BUG] Impossible to override SwXXX components (?) #354

bounoable opened this issue Aug 3, 2023 · 3 comments · Fixed by #357 or #1501
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@bounoable
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The documentation states that we should be able to override the packages/cms-base/components/SwProductCard.vue component but this doesn't actually work.

It seems like we can only override the components in packages/cms-base/components/public/cms, is that correct?

So to override the ProductCard layout, we would need to override packages/cms-base/components/public/cms/element/CmsElementProductBox.vue as a 1:1 copy of the original CmsElementProductBox.vue but referencing a custom implementation of ProductCard.vue ?

Thank you for your help

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Node:
- pnpm:

Anything else?

No response

@BrocksiNet
Copy link
Collaborator

BrocksiNet commented Aug 4, 2023

For me, it looks like you are right. At the moment you need to overwrite the CMS Components that you want to change and use your "customized" SwProductCard inside this. If you only change CmsElmentProductBox this will only help for this one CMS Element. But SwProductCard is used in 4 Files inside public/cms.

@patzick I guess we already talked about making this a way easier?
Maybe we should push this topic. What do you think?

Edit: We should also update the example in Docs when this is not possible.

@patzick patzick added the documentation Improvements or additions to documentation label Aug 7, 2023
@patzick
Copy link
Collaborator

patzick commented Aug 7, 2023

This needs to be corrected in the documentation. Component SwProductCart is only the internal component of cms-base package. The public api of the package are all CmsXXX named components, as this is what is coming from Shopware API as well.

Overwriting that way gives you way more flexibility and no problem with future upgrades of the package itself. So just create Product Cart component you wish to have in CMS and use it in desired CMS Element Component

@BrocksiNet
Copy link
Collaborator

What to do here? 😀

@BrocksiNet BrocksiNet moved this from In Review to Done in Composable Frontends Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
4 participants