src/Hooks/OrderList.php
/**
     * Draws Moloni column content
     *
     * @param string $currentColumnName Current column name
     *
     * @return void
     *
     * @throws Error
     */
Draws Moloni column content
@param string $currentColumnName Current column name

@return void

@throws Error
Draws Moloni column content @param string $currentColumnName Current column name @return void @throws Error
public function ordersListManageColumn($currentColumnName)
    {
        if (!$this->canShowColumn()) {
            return;
        }
        global $the_order;
        if ($currentColumnName === 'moloni_document') {
            $documentId = get_post_meta($the_order->ID, '_moloni_sent', true);
            if ($documentId > 0) {
                $redirectUrl = admin_url('admin.php?page=moloni&action=downloadDocument&id=' . $documentId);
                echo '<a class="button" target="_blank" onclick="window.open(\'' . $redirectUrl . '\', \'_blank\')">' . __('Descarregar') . '</a>';
            } else {
                echo '<div>' . _('Sem documento associado') . '</div>';
            }
        }
    }
public function ordersListManageColumn ( $ currentColumnName ) { if ( ! $ this -> canShowColumn ( ) ) { return ; } global $ the_order ; if ( $ currentColumnName === 'moloni_document' ) { $ documentId = get_post_meta ( $ the_order -> ID , '_moloni_sent' , true ) ; if ( $ documentId > 0 ) { $ redirectUrl = admin_url ( 'admin.php?page=moloni&action=downloadDocument&id=' . $ documentId ) ; echo '<a class="button" target="_blank" onclick="window.open(\'' . $ redirectUrl . '\', \'_blank\')">' . __ ( 'Descarregar' ) . '</a>' ; } else { echo '<div>' . _ ( 'Sem documento associado' ) . '</div>' ; } } }
Draws Moloni column content
 @param string $currentColumnName Current column name
Draws Moloni column content @param string $currentColumnName Current column name