我想在Akeneo V中编辑Variant组后检查某些属性值是否已更改.
不幸的是我有点迷失:有没有办法从a Pim\Bundle\CatalogBundle\Entity\Group到属性值?是否有另一种更好的方法来获取已编辑的Variant组的这些值?
我甚至无法找出MySQL中存储属性值的表(我刚刚找到pim_catalog_product_value了产品值).
我想在Akeneo中创建一个新的变体组,其中包含一些固定属性来"模拟"产品系列的行为.不幸的是,我不知道如何ProductTemplate使用空值来获取某些属性.
当我尝试下面的代码时,在Akeneo GUI中打开创建的变体组后出现错误:
Error: Option "attributes" must only contains instances of "Pim\Bundle\CatalogBundle\Entity\Attribute", got "Pim\Bundle\EnrichBundle\Form\Type\AvailableAttributesType"
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样:
$groupType = $this->groupManager
->getGroupTypeRepository()
->findOneBy(['code' => 'VARIANT']);
$group = $this->groupFactory->createGroup($groupType);
$group->setCode('MY_VARIANT_GROUP');
$attributes = array($this->attributeRepository->findOneByIdentifier('AXIS_ATTRIBUTE'));
$group->setAxisAttributes($attributes);
// ??? How can I create a new product value?
$productValue1 = new ProductValue();
$productValue1->setId('PREDEFINED_ATTRIBUTE1');
$productValue1->setAttribute($this->attributeRepository->findOneByIdentifier('PREDEFINED_ATTRIBUTE1'));
$productTemplate = new ProductTemplate();
$productTemplate->setValuesData(array($productValue1));
$group->setProductTemplate($productTemplate);
$this->groupSaver->save($group);
Run Code Online (Sandbox Code Playgroud) 我想覆盖ProductController来自EnrichBundle.
一切都在开发模式下工作,但是当我想在生产服务器上安装它时,php app/console pim:install --env=prod --force我得到错误并且Akeneo不工作:
Load "Title Templates" from annotations and config files to db
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Title for route "pim_enrich_attributegroup_index" could not be saved. Route not found.
oro:navigation:init
The command terminated with an error code: 1.
Run Code Online (Sandbox Code Playgroud)
安装工作,如果我取消注释getParent()方法MyEnrichBundle,但然后我ProductController不再工作.
class MyEnrichBundle extends Bundle
{
public function getParent()
{
return 'PimEnrichBundle';
}
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能避免这些ORO安装错误?
我在哪里可以下载以及如何在 Windows 10 / 64 位下为 php 7.1 (TS,VC14) 安装 mcrypt 扩展。我需要它用于 akeneo 项目,并且它具有使用 mcrypt(而不是其他扩展)的依赖项。
我还没有找到合适的扩展 dll。感谢帮助。