Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Order {
- public $_order;
- public function __construct( $order_id ) {
- if ( empty( $order_id ) ) {
- throw new Exception( '$order_id empty' );
- }
- $this->_order = $this->get( $order_id );
- }
- function get( $order_id ) {
- global $wpdb;
- $table_name = $wpdb->base_prefix . 'orders';
- $orders = $wpdb->get_row( "SELECT * FROM $table_name WHERE order_id = " . $order_id, ARRAY_A );
- return $order;
- }
- function get_total() {
- return $this->_order['total'];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement