开发者

How to access Magento order 'visible_on_front' property?

开发者 https://www.devze.com 2023-02-25 09:01 出处:网络
How to access Magento order \'visible_on_front\' property? I\'ve tried the following bits: $order = $this->getOrder();

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消