I want to count my orders by status (/admin->sales). I've manage to create some buttons with orders status and I want to insert a counter Pending (x), Canceled (y), Finish (z),...
I've tried to do this using $history_total attribute from pagination but I didn't manage to solve it.
Can you please help me with a solution?
*php newbie
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
And they all work well upto OC v.1.5.6.5_rc as well. But not all
of them look exactly like shown on the images below, because
I usually change a few details in my 'final' versions...
But for anything else, you'll have to get professional Support.
Ernie
---
Orders Statuses Report
https://www.opencart.com/index.php?rout ... n_id=13495
---
Multiple select option for Order status in Sales Report
https://www.opencart.com/index.php?rout ... n_id=17321
---
Custom Sales Reports
https://www.opencart.com/index.php?rout ... n_id=10022
---
Order List
https://www.opencart.com/index.php?rout ... on_id=3597
---
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Every button is one order status and if you click it will show you the orders with that status.
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
Code: Select all
<div class="tab">
<button onclick ="filter_status(this);" class="tablinks" value="0">Toate comenzile</button>
<button onclick ="filter_status(this);" class="tablinks" value="30">Comenzi Lipsa</button>
<?php foreach ($order_statuses as $order_status) { ?>
<button onclick ="filter_status(this);" class="tablinks" id="q_<?php echo $order_status['order_status_id']; ?>" value="<?php echo $order_status['order_status_id']; ?>"><?php
if($order_status['name'] == 'Finalizata') {echo '<span class="instoc"> </span>'; }
if($order_status['name'] == 'In procesare') {echo '<span class="inprocesare"> </span>'; }
if($order_status['name'] == 'Anulata') {echo '<span class="anulata"> </span>'; }
if($order_status['name'] == 'Nepreluata') {echo '<span class="nepreluata"> </span>'; }
if($order_status['name'] == 'Ridicare de la sediu') {echo '<span class="ridsediu"> </span>'; }
if($order_status['name'] == 'Asteptare plata OP') {echo '<span class="plataop"> </span>'; }
if($order_status['name'] == 'Plata card esuata') {echo '<span class="expirata"> </span>'; }
if($order_status['name'] == 'Stornata') {echo '<span class="stornata"> </span>'; }
if($order_status['name'] == 'Pregatita de Livrare') {echo '<img src="/image/data/prompt-service-clima-favicon.png" style="height:14px;display:inline-block;margin: 0 5px 0 0;" />'; }
if($order_status['name'] == 'Pregatita de Trimis') {echo '<img src="/image/data/FANCourier.png" style="height:14px;display:inline-block;margin: 0 5px 0 0;" />'; }
if($order_status['name'] == 'Platita online') {echo '<img src="/image/data/favicon-euplatesc.png" style="height:14px;display:inline-block;margin: 0 5px 0 0;" />'; }
if($order_status['name'] == 'Plata card nefinalizata') {echo '<span class="cnefinal"> </span>'; }
?><?php echo $order_status['name'].' ('.count(HERE I DON'T KNOW WHAT IS THE CODE).')'; ?></button>
<?php } ?>
</div>
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
prompt-service.ro: Centrale termice, Aer conditionat, Piese de schimb
lemnpefoc.ro: Lemne de foc
Vila Ancuta: Cazare Valea Doftanei
Valea Doftanei: Comuna Valea Doftanei
$my_query = $this->db->query("YOUR MYSQL HERE");
Then, you'd use whatever data you got from that query and put it in a variable like this:
$this->data['my_var'] = 'Some Data';
Once you've done that, you can use the variable in your template file, like this:
<?php echo $my_var; ?>
Hope that helps
Users browsing this forum: No registered users and 110 guests