How to access Magento order 'visible_on_front' property?
How to access Magento order 'visible_on_front' property?
I've tried the following bits:
$order = $this->getOrder();
$order->setStatus('processing');
$order->setData('visible_on_front', 1);
or
$history = $this->getOrder()->addStatusHistoryComment('msg');
$history->setStatus('processing');
$history->setData('state', 'visible');
or
$history = $this->getOrder()->addStatusHistoryComment('msg');
$history->setStatus('processing');
$history->setData('visible_on_front', 1);
开发者_如何学运维
Thanks in advance.
try this and see if it has changed after you changed the data
$order = $this->getOrder();
$order->setStatus('processing');
$order->setVisibleOnFront(1);
print_r($order->getData());
I've just had this need, I solved it like this:
$order->addStatusHistoryComment(<your comment>,<your status>)
->setIsVisibleOnFront(1);
Of course you load into $order the order you want to use.
With these you will have the comment visible into the user account page under the order details.
精彩评论