Pergunta

I'm running Magento 1.6.2.

I need to determine if an order is paid. If yes, I generate some XML data for export. There is many cases in the Magento order/payment/shipment workflow.

My first guess is when the attribute "state" of the order is defined as "processing", but I'm not sure because of the large amount of possibilities in this workflow. May be this case is not covering all the possibilities ...

Am I right with that ?

Foi útil?

Solução

You can call $order->getBaseTotalDue(). If this is 0, the order is fully paid.

Outras dicas

See Andreas answer on how to determine if there is anything left to pay. To answer your other question - using state == processing is not good enough. A quick test to show this is to ship an unpaid order - this will also move an order to the processing state even though the order is still unpaid.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top