由于一些奇怪的原因,在如此可配置的OroCommerce中,没有管理产品单元的能力,唯一的几个字doc says是可以通过web api添加单元。我需要添加“天”单位,最好是通过迁移在代码中做。仅仅使迁移像这样就足够了吗
INSERT INTO `oro_product_unit` (`code`, `default_precision`) VALUES ('day', '0');并添加翻译消息,如
oro.product_unit.day.label.full: day
oro.product.product_unit.day.label.full: day或者需要做其他的smth?
发布于 2021-02-26 16:58:06
可以使用数据fixture将产品单位加载到数据库中,就像下面这样加载默认单位:https://github.com/oroinc/orocommerce/blob/4.2.1/src/Oro/Bundle/ProductBundle/Migrations/Data/ORM/LoadProductUnitData.php#L47-L52
此外,您还必须为新单元提供翻译,但还有比问题中指定的更多的消息:https://github.com/oroinc/orocommerce/blob/ad94fe9bd63db28eae7d4a73743a4cada4f49080/src/Oro/Bundle/ProductBundle/Resources/translations/jsmessages.en.yml#L26-L35
https://stackoverflow.com/questions/66376348
复制相似问题