Пример #1
0
function foxyshop_print_invoice()
{
    global $foxyshop_settings;
    //Setup Fields and Defaults
    $foxy_data_defaults = array("is_test_filter" => "0", "hide_transaction_filter" => "0", "data_is_fed_filter" => "", "id_filter" => "", "order_total_filter" => "", "coupon_code_filter" => "", "transaction_date_filter_begin" => date("Y-m-d", strtotime("-10 days")), "transaction_date_filter_end" => date("Y-m-d"), "customer_id_filter" => "", "customer_email_filter" => "", "customer_first_name_filter" => "", "customer_last_name_filter" => "", "customer_state_filter" => "", "shipping_state_filter" => "", "customer_ip_filter" => "", "product_code_filter" => "", "product_name_filter" => "", "product_option_name_filter" => "", "product_option_value_filter" => "");
    $foxy_data = wp_parse_args(array("api_action" => "transaction_list"), $foxy_data_defaults);
    if (isset($_GET['foxyshop_search'])) {
        $fields = array("is_test_filter", "hide_transaction_filter", "data_is_fed_filter", "id_filter", "order_total_filter", "coupon_code_filter", "transaction_date_filter_begin", "transaction_date_filter_end", "customer_id_filter", "customer_email_filter", "customer_first_name_filter", "customer_last_name_filter", "customer_state_filter", "shipping_state_filter", "customer_ip_filter", "product_code_filter", "product_name_filter", "product_option_name_filter", "product_option_value_filter");
        foreach ($fields as $field) {
            if (isset($_GET[$field])) {
                $foxy_data[$field] = $_GET[$field];
            }
        }
        $foxy_data['pagination_start'] = isset($_GET['pagination_start']) ? $_GET['pagination_start'] : 0;
        if (version_compare($foxyshop_settings['version'], '0.7.0', ">")) {
            $foxy_data['entries_per_page'] = FOXYSHOP_API_ENTRIES_PER_PAGE;
        }
    }
    $foxy_response = foxyshop_get_foxycart_data($foxy_data);
    $xml = simplexml_load_string($foxy_response, NULL, LIBXML_NOCDATA);
    if ($xml->result == "ERROR") {
        echo '<h3>' . $xml->messages->message . '</h3>';
        die;
    }
    include foxyshop_get_template_file('/foxyshop-receipt.php');
    die;
}
function foxyshop_include($filename = "header")
{
    include foxyshop_get_template_file('/foxyshop-' . $filename . '.php');
}
function foxyshop_template_include()
{
    global $foxyshop_body_class_name;
    return foxyshop_get_template_file($foxyshop_body_class_name . ".php");
}