问题
如何检查商店所有者是否从订单对象发货或开具发票。
$this->registry->registry('current_order');
我有当前的订单对象,我想知道它是否已发货或已开票
答案
if ($order->getInvoiceCollection()->count()) {
// Invoice exist.
}
if ($order->getShipmentsCollection()->count()) {
// Shipment exist.
}
另外,您也可以这样做,
$order->hasInvoices() // For Invoice
$order->hasShipments() // For shipment