如何访问Magento订单的“ visible_on_front”属性?

问题描述

| 如何访问Magento订单的“ visible_on_front \”属性? 我已经尝试了以下位:
$order = $this->getorder();
$order->setStatus(\'processing\');
$order->setData(\'visible_on_front\',1);
要么
$history = $this->getorder()->addStatusHistoryComment(\'msg\');
$history->setStatus(\'processing\');
$history->setData(\'state\',\'visible\');
要么
$history = $this->getorder()->addStatusHistoryComment(\'msg\');
$history->setStatus(\'processing\');
$history->setData(\'visible_on_front\',1);
提前致谢。     

解决方法

尝试此操作,看看更改数据后它是否已更改
$order = $this->getOrder();
$order->setStatus(\'processing\');
$order->setVisibleOnFront(1);
print_r($order->getData());
    ,我刚刚有这个需要,我这样解决了:
$order->addStatusHistoryComment(<your comment>,<your status>)
      ->setIsVisibleOnFront(1);
当然,您将要使用的订单加载到$ order中。 使用这些,您将在订单详细信息下的用户帐户页面中看到注释。     

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...