gpt4 book ai didi

php - 设置默认 View 值标志时 Magento 的行为很奇怪

转载 作者:行者123 更新时间:2023-11-29 23:53:24 25 4
gpt4 key购买 nike

我目前正在尝试将magento 集成到erp 系统中。我为此编写了一个连接器,但在保存数据时遇到了问题。

这是我的代码

    if(!empty($currentTranslation['products_description']))
{
$product->setDescription($currentTranslation['products_description']);
}
else
if(!$default)
{
$product->setDescription(false);
}
else
{
$product->setDescription($primaryDefaultValues['desclong']);
}

(设置说明示例)

如果我未设置英语字段,则不应设置该值。对于每个商店 View ,默认值始终为 false,因此它将描述设置为 false。(我在双重检查过这一点)

如果我在保存之前查看该对象,我可以看到管理 View 的默认值。我还可以看到描述设置为 false。但是当我存储数据时,它会将默认值设置到字段中,并且不会设置使用默认 View 的标志。

我做错了什么?我也已经尝试过 0 和 null 。但没有任何效果。

请帮忙。

最佳答案

我解决了这个问题。看来我的缓存系统有问题。

关于php - 设置默认 View 值标志时 Magento 的行为很奇怪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25484016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com