Exemplo n.º 1
0
                    $return = true;
                } else {
                    if (get_post_type($key) == 'hotel_room') {
                        if ($post_type == 'st_hotel') {
                            $return = true;
                        }
                    } else {
                        $return = false;
                    }
                }
            }
            return $return;
        }
        static function _get_metabox_booking_types()
        {
            $booking_types = STTraveler::booking_type();
            $r = array();
            if (!empty($booking_types)) {
                foreach ($booking_types as $key => $value) {
                    if (post_type_exists($value)) {
                        $post_type_obj = get_post_type_object($value);
                        $r[] = array('label' => $post_type_obj->labels->singular_name, 'value' => $value);
                    }
                }
            }
            return $r;
        }
    }
    $a = new STCoupon();
    $a->init();
}
Exemplo n.º 2
0
 static function do_apply_coupon($code)
 {
     $status = STCoupon::get_coupon_value($code);
     if (!$status['status']) {
         return array('status' => 0, 'message' => $status['message']);
     } else {
         $_SESSION['st_cart_coupon'] = array('code' => $code, 'amount' => $status['value']);
         return array('status' => 1);
     }
 }