by
265 8
0
5
658
1
Top 5% !
Popular
Tagged
Specified
OpenSource
Created
Modified Apr 11, 2018

Published on:

Languagehtml+php
LanguagePHP
LicenseMIT_X11

Using WooCommerce Rest API for Custom Dashboard

Using WooCommerce Rest API (https://www.cloudways.com/blog/custom-dashboard-using-woocommerce-php-rest-api/ ) to create a Custom Dashboard
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/3657564/Using-WooCommerce-Rest-API-for-Custom-Da?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<div class="container">                                   <h2 class="sub-header">Customers List</h2>                                   <div class='table-responsive'>                                       <table id='myTable' class='table table-striped table-bordered'>                                           <thead>                                               <tr>                                                   <th>Email</th>                                                   <th>Name</th>                                                   <th>Billing Address</th>                                                   <th>Total Orders</th>                                                   <th>Total spent</th>                                                   <th>Avatar</th>                                                   <th>Actions</th>                                               </tr>                                           </thead>                                           <tbody>                                               <?php                   foreach($customers as $customer){                   echo "<tr><td>" . $customer["email"]."</td>                             <td>" . $customer["first_name"].$customer["last_name"]."</td>                             <td>" . $customer["billing"]["address_1"]."</td>                             <td>" . $customer["orders_count"]."</td>                             <td>" . $customer["total_spent"]."</td>                             <td><img height='50px' width='50px' src='".$customer["avatar_url"]."'></td>                              <td><a class='open-AddBookDialog btn btn-primary' data-target='#myModal' data-id=".$customer['id']." data-toggle='modal'>Update</a>                              <a class='open-deleteDialog btn btn-danger' data-target='#myModal1' data-id=".$customer['id']." data-toggle='modal'>Delete</a></td></tr>";                   }                   ?>                                           </tbody>                                       </table>                                   </div>   </div>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus