Skip to content

Instantly share code, notes, and snippets.

@rafhaelhp
Last active January 4, 2020 19:02
Show Gist options
  • Save rafhaelhp/e76bd7f9aaba8b4e8c0ad1c1d97d3bda to your computer and use it in GitHub Desktop.
Save rafhaelhp/e76bd7f9aaba8b4e8c0ad1c1d97d3bda to your computer and use it in GitHub Desktop.
Ultimos pedidos Mercado Livre Dashboard
/*
* =====================================================
* Opcional: Box de exibição dos ultimos pedidos Mercado Livre para ser exibido na dashboard do painel.
* =====================================================
*/
<div class="box box50">
<div class="panel_header alert">
<h2 class="icon-cart">ÚLTIMOS PEDIDOS MERCADO LIVRE:</h2>
</div>
<div class="panel dashboard_orders">
<?php
$Read->FullRead("SELECT * FROM " . DB_ML_ORDERS . " ORDER BY order_date DESC LIMIT 4");
if (!$Read->getResult()):
echo Erro("<span class='icon-info al_center'>Ainda não existem pedidos realizados através do Mercado Livre!</span>", E_USER_NOTICE);
else:
foreach ($Read->getResult() as $Order):
extract($Order);
echo "<p class='order'><span><a title='Detalhes do pedido' href='dashboard.php?wc=mercadolivre/order&id={$order_id}'>#{$ml_order_id}</a></span><span>" . date("d/m/Y", strtotime($order_date)) . "</span><span>R$ " . number_format($order_price, '2', ',', '.') . "</span><span>" . getMlOrderStatus($order_status)['name'] . "</span></p>";
endforeach;
endif;
?>
<div class="clear"></div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment