简体   繁体   English

在 Shopware 6 中使用 associationField 扩展购物车

[英]Extend Cart with an associationField in Shopware 6

I have a problem with the cart of Shopware 6.我的 Shopware 6 购物车有问题。

I need to extend it adding a field to make an association with a "Shop" entity I've created, but I don't see in the documentation a way to do it.我需要扩展它,添加一个字段以与我创建的“商店”实体建立关联,但我没有在文档中看到执行此操作的方法。

Before to start I though that Carts were defined like other data structure in Shopware, using Entity and EntityDefinition class in php that you can extend with an EntityExtension, but this is not the case and I don't understand how to move in this case.在开始之前,我虽然在 Shopware 中使用 Entity 和 EntityDefinition class 中的 EntityDefinition class 可以使用 EntityExtension 进行扩展,但事实并非如此,我不明白在这种情况下如何移动。

Can someone help me?有人能帮我吗?

Maybe I missunderstand the goal, but if it's only having some field in storefront, which can be maintained in BE, you might have a look at也许我误解了目标,但如果它只是在店面有一些领域,可以在 BE 中维护,你可能会看看

https://docs.shopware.com/en/shopware-6-en/settings/custom-fields https://docs.shopware.com/en/shopware-6-en/settings/custom-fields

and if you want to take action by controller maybe this one?如果您想通过 controller 采取行动,也许这个?

https://developer.shopware.com/docs/guides/plugins/plugins/framework/custom-field https://developer.shopware.com/docs/guides/plugins/plugins/framework/custom-field

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM