public static function get_instance()
 {
     if (self::$instance === null) {
         self::$instance = new QHShopTool();
     }
     return self::$instance;
 }
                    </td>
                </tr>
                <?php 
    }
    ?>
                </tbody>
                <tfoot>


                <tr class="order-total">
                    <th><?php 
    _e('Order Total', 'qhshop');
    ?>
</th>
                    <td><strong><span class="amount"><?php 
    echo QHShopTool::get_currency($total, $option);
    ?>
</span></strong></td>
                </tr>


                </tfoot>
            </table>


            <div id="payment">

                <div class="form-row place-order">

                    <noscript>Since your browser does not support JavaScript, or it is disabled, please ensure you click
                        the &amp;lt;em&amp;gt;Update Totals&amp;lt;/em&amp;gt; button before placing your order. You may
                                    <div itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
                                        <?php 
        $status = array('0' => __('Out of stock', 'qhshop'), '1' => __('In stock', 'qhshop'), '2' => __('Call', 'qhshop'));
        ?>
                                        <p><?php 
        printf(__('Status: %s', 'qhshop'), $data['product_status'] != 2 ? $status[$data['product_status']] : '<em style="color:red">' . $status[$data['product_status']] . '</em>');
        ?>
</p>

                                        <p class="price">
                                            <del><span class="amount"><?php 
        echo QHShopTool::get_currency($data['regular_price'], $option);
        ?>
</span></del>
                                            <ins><span class="amount"><?php 
        echo QHShopTool::get_currency($data['sale_price'], $option);
        ?>
 VND</span></ins>
                                        </p>
                                    </div>
                                    <p class="stock in-stock"><?php 
        printf(_n('1 in stock', '%s in stocks', $data['product_quantity'], 'qhshop'), $data['product_quantity']);
        ?>
</p>

                                    <form class="cart" method="post" enctype="multipart/form-data"
                                          action="<?php 
        echo get_permalink();
        ?>
">
 public static function delete_cart_ajax()
 {
     $json['status'] = 0;
     if (isset($_POST['item_id']) && !empty($_POST['item_id'])) {
         $cart = QHShopSession::get('cart');
         $option = get_option('qhshop_setting');
         if (!empty($cart)) {
             QHShopSession::destroy($_POST['item_id']);
             $total = 0;
             foreach ($cart as $item) {
                 $total += $item['item_quantity'] * $item['item_price'];
             }
             $json['subtotal'] = QHShopTool::get_currency($total, $option);
             $json['status'] = 1;
         }
     }
     wp_send_json_success($json);
 }
 public static function list_orders($columns, $post_id)
 {
     $data = get_post_meta($post_id, 'order')[0];
     $option = get_option('qhshop_setting');
     switch ($columns) {
         case 'order':
             $link = get_edit_post_link($post_id);
             echo '<a href="' . $link . '">#' . $post_id . '</a>';
             break;
         case 'purchased':
             echo count($data['cart']);
             break;
         case 'status':
             $select_arr = array('0' => __('Pending', 'qhshop'), '1' => __('Processing', 'qhshop'), '2' => __('Complete', 'qhshop'));
             foreach ($select_arr as $key => $value) {
                 if (isset($data['status']) && $data['status'] == $key) {
                     echo $value;
                 }
             }
             break;
         case 'total_price':
             $total = 0;
             foreach ($data['cart'] as $item) {
                 $total += $item['item_quantity'] * $item['item_price'];
             }
             QHShopTool::get_currency($total, $option);
             break;
     }
 }
        echo get_permalink($id);
        ?>
">
                <?php 
        if (has_post_thumbnail($id)) {
            echo get_the_post_thumbnail($id, 'thumbnail', array('class' => 'attachment-shop_thumbnail wp-post-image'));
        }
        echo $item['item_name'];
        ?>

            </a>
            <span class="quantity"><?php 
        echo $item['item_quantity'];
        ?>
 X <span class="amount"><?php 
        echo QHShopTool::get_currency($item['item_price'], $option);
        ?>
</span>
            <a href="<?php 
        add_query_arg('delete-cart', $id);
        ?>
" style="display:inline;color:red;" class="delete_button" data-item-id="<?php 
        echo $id;
        ?>
">[X]</a>
        </li>

    <?php 
    }
    echo '<span id="qhshop-cart-subtotal" data-value="' . QHShopTool::get_currency($total, $option) . '"></span>';
}
 public static function list_products($columns, $post_id)
 {
     $data = get_post_meta($post_id, 'product')[0];
     $option = get_option('qhshop_setting');
     switch ($columns) {
         case 'sale_price':
             echo QHShopTool::get_currency($data['sale_price'], $option);
             break;
         case 'post_thumb':
             if (has_post_thumbnail($post_id)) {
                 echo get_the_post_thumbnail($post_id, 'thumbnal');
             }
             break;
     }
 }