• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nzshpcrt_currency_display函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中nzshpcrt_currency_display函数的典型用法代码示例。如果您正苦于以下问题:PHP nzshpcrt_currency_display函数的具体用法?PHP nzshpcrt_currency_display怎么用?PHP nzshpcrt_currency_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了nzshpcrt_currency_display函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: nzshpcrt_specials

function nzshpcrt_specials($input = null)
{
    global $wpdb;
    $image_width = get_option('product_image_width');
    $image_height = get_option('product_image_height');
    $siteurl = get_option('siteurl');
    $sql = "SELECT * FROM `" . WPSC_TABLE_PRODUCT_LIST . "` WHERE `special_price` != '0.00'  AND `active` IN ('1') ORDER BY RAND() LIMIT 1";
    $product = $wpdb->get_results($sql, ARRAY_A);
    if ($product != null) {
        $output = "<div>";
        foreach ($product as $special) {
            $special['name'] = htmlentities(stripslashes($special['name']), ENT_QUOTES, "UTF-8");
            $output .= "<strong><a class='wpsc_product_title' href='" . wpsc_product_url($special['id'], $special['category']) . "'>" . $special['name'] . "</a></strong><br /> ";
            if (is_numeric($special['image'])) {
                $image_file_name = $wpdb->get_var("SELECT `image` FROM `" . WPSC_TABLE_PRODUCT_IMAGES . "` WHERE `id`= '" . $special['image'] . "' LIMIT 1");
                if ($image_file_name != '') {
                    $image_path = "index.php?productid=" . $special['id'] . "&amp;width=" . $image_width . "&amp;height=" . $image_height . "";
                    $output .= "<img src='" . $image_path . "' title='" . $special['name'] . "' alt='" . $special['name'] . "' /><br />";
                }
            }
            //exit('Widget specisl'.get_option('wpsc_special_description'));
            if (get_option('wpsc_special_description') != '1') {
                $output .= $special['description'] . "<br />";
            }
            $variations_processor = new nzshpcrt_variations();
            $variations_output = $variations_processor->display_product_variations($special['id'], true, false, true);
            $output .= $variations_output[0];
            if ($variations_output[1] !== null) {
                $special['price'] = $variations_output[1];
                $special['special_price'] = 0;
            }
            if ($variations_output[1] == null) {
                $output .= "<span class='oldprice'>" . nzshpcrt_currency_display($special['price'], $special['notax'], false) . "</span><br />";
            }
            $output .= "<span id='special_product_price_" . $special['id'] . "'><span class='pricedisplay'>";
            $output .= nzshpcrt_currency_display($special['price'] - $special['special_price'], $special['notax'], false, $product['id']);
            $output .= "</span></span><br />";
            $output .= "<form id='specials_" . $special['id'] . "' method='post' action='' onsubmit='submitform(this, null);return false;' >";
            $output .= "<input type='hidden' name='product_id' value='" . $special['id'] . "'/>";
            $output .= "<input type='hidden' name='item' value='" . $special['id'] . "' />";
            $output .= "<input type='hidden' name='wpsc_ajax_action' value='special_widget' />";
            if ($special['quantity_limited'] == 1 && $special['quantity'] < 1) {
                $output .= TXT_WPSC_PRODUCTSOLDOUT . "";
            } else {
                //$output .= $variations_processor->display_product_variations($special['id'],true);
                $output .= "<input type='submit' name='" . TXT_WPSC_ADDTOCART . "' value='" . TXT_WPSC_ADDTOCART . "'  />";
            }
            $output .= "</form>";
        }
        $output .= "</div>";
    } else {
        $output = '';
    }
    echo $input . $output;
}
开发者ID:papayalabs,项目名称:htdocs,代码行数:55,代码来源:specials_widget.php


示例2: display_product_extras

 function display_product_extras($product_id, $no_label = false, $no_br = false, $update_price = false)
 {
     global $wpdb;
     $output = '';
     $sql = "SELECT * FROM `" . $wpdb->prefix . "product_list` WHERE `id`='" . $product_id . "' LIMIT 1";
     $product_data = $wpdb->get_row($sql, ARRAY_A);
     $extras_assoc_sql = "SELECT * FROM `" . $wpdb->prefix . "extras_values_associations` WHERE product_id IN ('{$product_id}')";
     $extras_assoc_data = $wpdb->get_results($extras_assoc_sql, ARRAY_A);
     if (count($extras_assoc_data) == 0) {
         return '';
     }
     foreach ($extras_assoc_data as $extras_association) {
         $extras_ids[] = $extras_association['extras_id'];
     }
     //echo
     $special = 'false';
     if ($no_label == true) {
         $special = 'true';
     }
     $extras_ids_str = implode(',', $extras_ids);
     $extras_name_sql = "SELECT * FROM " . $wpdb->prefix . "product_extra WHERE id IN (" . $extras_ids_str . ") ORDER BY id";
     $extras_name_data = $wpdb->get_results($extras_name_sql, ARRAY_A);
     //exit("<pre>".print_r($extras_name_data,1)."</pre>");
     $j = 0;
     $x = 0;
     foreach ($extras_name_data as $extras_name_datum) {
         $j++;
         $extras_value_sql = "SELECT * FROM " . $wpdb->prefix . "extras_values WHERE extras_id IN (" . $extras_name_datum['id'] . ")";
         $extras_value_data = $wpdb->get_results($extras_value_sql, ARRAY_A);
         //exit("<pre>".print_r($extras_value_data,1)."</pre>");
         $output .= "<label>" . $extras_name_datum['name'] . "</label>" . $extras_name_datum['price'] . "<br>";
         if ($j == 1) {
             $price = '';
             $checked = 'checked="checked"';
         } else {
             $price = nzshpcrt_currency_display($extras_assoc_data[$x]['price'], 0);
             $checked = '';
         }
         foreach ($extras_value_data as $extras_value_datum) {
             if ($j == 1) {
                 $price = '';
             } else {
                 $price = nzshpcrt_currency_display($extras_assoc_data[$x]['price'], 0);
             }
             $output .= "<input style='float:left;' type='checkbox' {$checked} name='extras[]' value='" . $extras_value_datum['id'] . "' class='extras_" . $product_id . "' id='extras_" . $product_id . "_" . $extras_value_datum['id'] . "' onclick='manage_extras(" . $product_id . "," . $extras_value_datum['id'] . "," . $special . ")' id='extra_value_id_" . $extras_value_datum['id'] . "'><label style='float:left;' for='extras_" . $product_id . "_" . $extras_value_datum['id'] . "'>" . $extras_value_datum['name'] . "&ensp;" . $price . "</label><img style='display:none;float:left;' id='extras_indicator" . $product_id . $extras_value_datum['id'] . "' src=' " . WPSC_DIR_NAME . "/images/indicator.gif'><br>";
             $x++;
         }
     }
     return $output;
 }
开发者ID:alx,项目名称:barceloneta,代码行数:50,代码来源:extra.class.php


示例3: wpsc_grid_title_and_price

 function wpsc_grid_title_and_price(&$product)
 {
     $output .= "<div class='grid_price'>";
     if ($soldout) {
         $output .= "<span class='soldoutgrid'>Sold out</span>";
     } else {
         if ($product['special'] == 1) {
             $output .= nzshpcrt_currency_display($product['price'] - $product['special_price'], $product['notax'], false, $product['id']) . "\n\r";
         } else {
             $output .= nzshpcrt_currency_display($product['price'], $product['notax']) . "\n\r";
         }
     }
     $output .= "</div>";
     $output .= "<div class='grid_prodcut_title'><a href='" . wpsc_product_url($product['id']) . "'>" . stripslashes($product['name']) . "</a></div>";
     return $output;
 }
开发者ID:alx,项目名称:barceloneta,代码行数:16,代码来源:marketplace.php


示例4: nzshpcrt_specials

function nzshpcrt_specials($input = null)
{
    global $wpdb;
    $siteurl = get_option('siteurl');
    $sql = "SELECT * FROM `" . $wpdb->prefix . "product_list` WHERE `special` = '1'  ORDER BY RAND() LIMIT 1";
    $product = $wpdb->get_results($sql, ARRAY_A);
    if ($product != null) {
        $output = "<div><div>";
        foreach ($product as $special) {
            $output .= "<strong>" . $special['name'] . "</strong><br /> ";
            if ($special['image'] != null) {
                $output .= "<img src='{$siteurl}/wp-content/plugins/wp-shopping-cart/product_images/thumbnails/" . $special['image'] . "' title='" . $special['name'] . "' alt='" . $special['name'] . "' /><br />";
            }
            $output .= $special['description'] . "<br />";
            //       $output .= $special['price'];
            $variations_processor = new nzshpcrt_variations();
            $variations_output = $variations_processor->display_product_variations($special['id'], true, false, true);
            $output .= $variations_output[0];
            if ($variations_output[1] !== null) {
                $special['price'] = $variations_output[1];
            }
            if ($variations_output[1] == null) {
                $output .= "<span class='oldprice'>" . nzshpcrt_currency_display($special['price'], $special['notax'], false) . "</span><br />";
            }
            $output .= "<span id='special_product_price_" . $special['id'] . "'><span class='pricedisplay'>";
            $output .= nzshpcrt_currency_display($special['price'] - $special['special_price'], $special['notax'], false, $product['id']);
            $output .= "</span></span><br />";
            $output .= "<form id='specials_" . $special['id'] . "' name='{$num}' method='post' action='#' onsubmit='submitform(this);return false;' >";
            $output .= "<input type='hidden' name='prodid' value='" . $special['id'] . "'/>";
            $output .= "<input type='hidden' name='item' value='" . $special['id'] . "' />";
            if ($special['quantity_limited'] == 1 && $special['quantity'] < 1) {
                $output .= TXT_WPSC_PRODUCTSOLDOUT . "";
            } else {
                //$output .= $variations_processor->display_product_variations($special['id'],true);
                $output .= "<input type='submit' name='" . TXT_WPSC_ADDTOCART . "' value='" . TXT_WPSC_ADDTOCART . "'  />";
            }
            $output .= "</form>";
        }
        $output .= "</div></div>";
    } else {
        $output = '';
    }
    echo $input . $output;
}
开发者ID:alx,项目名称:barceloneta,代码行数:44,代码来源:specials_widget.php


示例5: nzshpcrt_price_range

function nzshpcrt_price_range($input = null)
{
    global $wpdb;
    $siteurl = get_option('siteurl');
    $product_page = get_option("product_list_url");
    if (stristr($product_page, "?")) {
        $seperater = '&';
    } else {
        $seperater = '?';
    }
    $result = $wpdb->get_results("SELECT DISTINCT `price` FROM " . WPSC_TABLE_PRODUCT_LIST . " WHERE `active` IN ('1') ORDER BY price ASC", ARRAY_A);
    if ($result != null) {
        sort($result);
        $count = count($result);
        $price_seperater = ceil($count / 6);
        for ($i = 0; $i < $count; $i += $price_seperater) {
            $ranges[] = round($result[$i]['price'], -1);
        }
        $ranges = array_unique($ranges);
        $final_count = count($ranges);
        $ranges = array_merge(array(), $ranges);
        $_SESSION['price_range'] = $ranges;
        //	echo('<pre>'.print_r($ranges, true).'</pre>');
        for ($i = 0; $i < $final_count; $i++) {
            $j = $i;
            if ($i == $final_count - 1) {
                echo "<a href='" . htmlentities($product_page . $seperater . "range=" . $j) . "'>Over " . nzshpcrt_currency_display($ranges[$i], 1, true) . "</a><br/>";
            } else {
                if ($ranges[$i] == 0) {
                    echo "<a href='" . htmlentities($product_page . $seperater . "range=" . $j) . "'>Under " . nzshpcrt_currency_display($ranges[$i + 1], 1, true) . "</a><br/>";
                } else {
                    echo "<a href='" . htmlentities($product_page . $seperater . "range=" . $j) . "'>" . nzshpcrt_currency_display($ranges[$i], 1, true) . " - " . nzshpcrt_currency_display($ranges[$i + 1], 1, true) . "</a><br/>";
                }
            }
        }
        if (get_option('permalink_structure') != '') {
            $seperator = "?";
        } else {
            $seperator = "&amp;";
        }
        echo "<a href='" . get_option("product_list_url") . $seperator . "range=all'>" . __('Show All', 'wpsc') . "</a><br/>";
    }
}
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:43,代码来源:price_range_widget.php


示例6: transaction_results


//.........这里部分代码省略.........
                if ($purchase_log['email_sent'] != 1) {
                    $wpdb->query("UPDATE `" . WPSC_TABLE_DOWNLOAD_STATUS . "` SET `active`='1' WHERE (`fileid` = '{$product_data['file']}' OR `cartid` = '{$row['id']}' ) AND `purchid` = '{$purchase_log['id']}'");
                }
                do_action('wpsc_transaction_result_cart_item', array("purchase_id" => $purchase_log['id'], "cart_item" => $row, "purchase_log" => $purchase_log));
                if ($purchase_log['processed'] >= 2) {
                    $download_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "`\r\n\t\t\t\t\t INNER JOIN `" . WPSC_TABLE_PRODUCT_FILES . "`\r\n\t\t\t\t\t  ON `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`fileid` = `" . WPSC_TABLE_PRODUCT_FILES . "`.`id`\r\n\t\t\t\t\t  WHERE `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`active`='1'\r\n\t\t\t\t\t  AND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`purchid`='" . $purchase_log['id'] . "'\r\n\t\t\t\t\t  AND (\r\n\t\t\t\t\t\t`" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`cartid` = '" . $row['id'] . "'\r\n\t\t\t\t\t\t\tOR (\r\n\t\t\t\t\t\t\t\t`" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`cartid` IS NULL\r\n\t\t\t\t\t\t\t\tAND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`fileid` = '{$product_data['file']}'\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tAND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`id` NOT IN ('" . implode("','", $previous_download_ids) . "')", ARRAY_A);
                    $link = array();
                    //exit('IM HERE'.$errorcode.'<pre>'.print_r($download_data).'</pre>');
                    if (sizeof($download_data) != 0) {
                        foreach ($download_data as $single_download) {
                            if ($single_download['uniqueid'] == null) {
                                // if the uniqueid is not equal to null, its "valid", regardless of what it is
                                $link[] = array("url" => site_url("?downloadid=" . $single_download['id']), "name" => $single_download["filename"]);
                            } else {
                                $link[] = array("url" => site_url("?downloadid=" . $single_download['uniqueid']), "name" => $single_download["filename"]);
                            }
                        }
                        //$order_status= 4;
                    } else {
                        $order_status = $purchase_log['processed'];
                    }
                    $previous_download_ids[] = $download_data['id'];
                    do_action('wpsc_confirm_checkout', $purchase_log['id']);
                }
                //	do_action('wpsc_confirm_checkout', $purchase_log['id']);
                $shipping = $row['pnp'];
                $total_shipping += $shipping;
                if ($product_data['special'] == 1) {
                    $price_modifier = $product_data['special_price'];
                } else {
                    $price_modifier = 0;
                }
                $total += $row['price'] * $row['quantity'];
                $message_price = nzshpcrt_currency_display($row['price'] * $row['quantity'], $product_data['notax'], true);
                $shipping_price = nzshpcrt_currency_display($shipping, 1, true);
                $variation_values = $wpdb->get_col("SELECT `value_id`  FROM `" . WPSC_TABLE_CART_ITEM_VARIATIONS . "` WHERE `cart_id`='{$row['id']}'");
                //echo "<pre>".print_r($product_data,true)."</pre>";
                $variation_count = count($variation_values);
                if ($purchase['gateway'] != 'testmode') {
                    if ($gateway['internalname'] == $purch_data[0]['gateway']) {
                        $gateway_name = $gateway['name'];
                    }
                } else {
                    $gateway_name = "Manual Payment";
                }
                //echo "<pre>".print_r($variation_values,true)."</pre>";
                $variation_list = '';
                if ($variation_count > 0) {
                    $value_names = $wpdb->get_col("SELECT `name` FROM `" . WPSC_TABLE_VARIATION_VALUES . "` WHERE `id` IN ('" . implode("','", $variation_values) . "')");
                    $variation_list = " (" . stripslashes(implode(", ", $value_names)) . ")";
                }
                if ($link != '' && !empty($link)) {
                    $additional_content = apply_filters('wpsc_transaction_result_content', array("purchase_id" => $purchase_log['id'], "cart_item" => $row, "purchase_log" => $purchase_log));
                    if (!is_string($additional_content)) {
                        $additional_content = '';
                    }
                    //$product_list .= " - ". $product_data['name'] . stripslashes($variation_list) ."  ".$message_price ." ".__('Click to download', 'wpsc').":\n\r $link\n\r".$additional_content;
                    //$product_list_html .= " - ". $product_data['name'] . stripslashes($variation_list) ."  ".$message_price ."&nbsp;&nbsp;<a href='$link'>".__('Click to download', 'wpsc')."</a>\n". $additional_content;
                    $product_list .= " - " . $product_data['name'] . stripslashes($variation_list) . "  " . $message_price;
                    $product_list_html .= " - " . $product_data['name'] . stripslashes($variation_list) . "  " . $message_price;
                    foreach ($link as $single_link) {
                        $product_list .= "\n\r " . $single_link["name"] . ": " . $single_link["url"] . "\n\r";
                        $product_list_html .= "<a href='" . $single_link["url"] . "'>" . $single_link["name"] . "</a>\n";
                        $report_product_list .= "\n\r " . $single_link["name"] . ": " . $single_link["url"] . "\n\r";
                        //	$report_product_list .="<a href='".$single_link["url"]."'>".$single_link["name"]."</a>\n";
                    }
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:67,代码来源:transaction_result_functions.php


示例7: wpsc_display_coupons_page


//.........这里部分代码省略.........
    echo "    </th>\n\r";
    echo "    <th>\n\r";
    echo __('Start', 'wpsc');
    echo "    </th>\n\r";
    echo "    <th>\n\r";
    echo __('Expiry', 'wpsc');
    echo "    </th>\n\r";
    echo "    <th>\n\r";
    echo __('Active', 'wpsc');
    echo "    </th>\n\r";
    echo "    <th>\n\r";
    echo __('Apply On All Products', 'wpsc');
    echo "    </th>\n\r";
    echo "    <th>\n\r";
    echo __('Edit', 'wpsc');
    echo "    </th>\n\r";
    $i = 0;
    $coupon_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_COUPON_CODES . "` ", ARRAY_A);
    //exit('Coupon Data<pre>'.print_r($coupon_data, true).'</pre>');
    foreach ((array) $coupon_data as $coupon) {
        $alternate = "";
        $i++;
        if ($i % 2 != 0) {
            $alternate = "class='alt'";
        }
        echo "<tr {$alternate}>\n\r";
        echo "    <td>\n\r";
        echo $coupon['coupon_code'];
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        if ($coupon['is-percentage'] == 1) {
            echo $coupon['value'] . "%";
        } else {
            echo nzshpcrt_currency_display($coupon['value'], 1);
        }
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        echo date("d/m/Y", strtotime($coupon['start']));
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        echo date("d/m/Y", strtotime($coupon['expiry']));
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        switch ($coupon['active']) {
            case 1:
                echo "<img src='" . WPSC_URL . "/images/yes_stock.gif' alt='' title='' />";
                break;
            case 0:
            default:
                echo "<img src='" . WPSC_URL . "/images/no_stock.gif' alt='' title='' />";
                break;
        }
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        switch ($coupon['every_product']) {
            case 1:
                echo "<img src='" . WPSC_URL . "/images/yes_stock.gif' alt='' title='' />";
                break;
            case 0:
            default:
                echo "<img src='" . WPSC_URL . "/images/no_stock.gif' alt='' title='' />";
                break;
        }
        echo "    </td>\n\r";
        echo "    <td>\n\r";
        echo "<a title='" . $coupon['coupon_code'] . "' href='javascript:void(0)' class='wpsc_edit_coupon'  >" . __('Edit', 'wpsc') . "</a>";
开发者ID:kasima,项目名称:wp-e-commerce-ezp,代码行数:67,代码来源:display-coupons.php


示例8: transaction_results

function transaction_results($sessionid, $echo_to_screen = true, $transaction_id = null)
{
    global $wpdb, $wpsc_cart;
    //$curgateway = get_option('payment_gateway');
    $curgateway = $wpdb->get_var("SELECT gateway FROM " . WPSC_TABLE_PURCHASE_LOGS . " WHERE sessionid='{$sessionid}'");
    $errorcode = 0;
    $order_status = 2;
    $siteurl = get_option('siteurl');
    /*
     * {Notes} Double check that $Echo_To_Screen is a boolean value
     */
    $echo_to_screen = !is_bool($echo_to_screen) ? true : $echo_to_screen;
    //exit('triggered but with errors?'.$echo_to_screen);
    if (is_numeric($sessionid)) {
        if ($echo_to_screen) {
            echo apply_filters('wpsc_pre_transaction_results', '');
        }
        $purchase_log = $wpdb->get_row("SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `sessionid`= " . $sessionid . " LIMIT 1", ARRAY_A);
        if ($purchase_log['gateway'] == "testmode" && $purchase_log['processed'] < 2) {
            $message = get_option('wpsc_email_receipt');
            $message_html = $message;
        } else {
            $message = get_option('wpsc_email_receipt');
            $message_html = $message;
        }
        $order_url = $siteurl . "/wp-admin/admin.php?page=" . WPSC_DIR_NAME . "/display-log.php&amp;purchcaseid=" . $purchase_log['id'];
        if ($_GET['ipn_request'] != 'true' and get_option('paypal_ipn') == 1) {
            if ($purchase_log == null) {
                echo TXT_WPSC_ORDER_FAILED;
                if (get_option('purch_log_email') != null && $purchase_log['email_sent'] != 1) {
                    wp_mail(get_option('purch_log_email'), TXT_WPSC_NEW_ORDER_PENDING_SUBJECT, TXT_WPSC_NEW_ORDER_PENDING_BODY . $order_url, "From: " . get_option('return_email') . "");
                }
                return false;
            } else {
                if ($purchase_log['processed'] < 2) {
                    //added by Thomas on 20/6/2007
                    echo TXT_WPSC_ORDER_PENDING . "<p style='margin: 1em 0px 0px 0px;' >" . nl2br(get_option('payment_instructions')) . "</p>";
                    /*if($purchase_log['gateway'] != 'testmode') {
                    			if((get_option('purch_log_email') != null) && ($purchase_log['email_sent'] != 1)) {
                    				mail(get_option('purch_log_email'), TXT_WPSC_NEW_ORDER_PENDING_SUBJECT, TXT_WPSC_NEW_ORDER_PENDING_BODY.$order_url, "From: ".get_option('return_email')."");
                    			}
                    			return false;
                    		}*/
                }
            }
        }
        $cart = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_CART_CONTENTS . "` WHERE `purchaseid`='{$purchase_log['id']}'", ARRAY_A);
        if ($purchase_log['shipping_country'] != '') {
            $billing_country = $purchase_log['billing_country'];
            $shipping_country = $purchase_log['shipping_country'];
        } else {
            $country = $wpdb->get_var("SELECT `value` FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id`=" . $purchase_log['id'] . " AND `form_id` = '" . get_option('country_form_field') . "' LIMIT 1");
            $billing_country = $country;
            $shipping_country = $country;
        }
        $email_form_field = $wpdb->get_results("SELECT `id`,`type` FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `type` IN ('email') AND `active` = '1' ORDER BY `order` ASC LIMIT 1", ARRAY_A);
        $email = $wpdb->get_var("SELECT `value` FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id`=" . $purchase_log['id'] . " AND `form_id` = '" . $email_form_field[0]['id'] . "' LIMIT 1");
        $stock_adjusted = false;
        $previous_download_ids = array(0);
        $product_list = '';
        if ($cart != null && $errorcode == 0) {
            foreach ($cart as $row) {
                $link = "";
                $product_data = $wpdb->get_row("SELECT * FROM `" . WPSC_TABLE_PRODUCT_LIST . "` WHERE `id`='{$row['prodid']}' LIMIT 1", ARRAY_A);
                if ($purchase_log['email_sent'] != 1) {
                    $wpdb->query("UPDATE `" . WPSC_TABLE_DOWNLOAD_STATUS . "` SET `active`='1' WHERE (`fileid` = '{$product_data['file']}' OR `cartid` = '{$row['id']}' ) AND `purchid` = '{$purchase_log['id']}'");
                }
                do_action('wpsc_transaction_result_cart_item', array("purchase_id" => $purchase_log['id'], "cart_item" => $row, "purchase_log" => $purchase_log));
                if ($purchase_log['processed'] >= 2) {
                    //echo "SELECT * FROM `".WPSC_TABLE_DOWNLOAD_STATUS."` WHERE `active`='1' AND `purchid`='".$purchase_log['id']."' AND (`cartid` = '".$row['id']."' OR (`cartid` IS NULL AND `fileid` = '{$product_data['file']}') ) AND `id` NOT IN ('".implode("','",$previous_download_ids)."') LIMIT 1";
                    $download_data = $wpdb->get_row("SELECT * FROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` WHERE `active`='1' AND `purchid`='" . $purchase_log['id'] . "' AND (`cartid` = '" . $row['id'] . "' OR (`cartid` IS NULL AND `fileid` = '{$product_data['file']}') ) AND `id` NOT IN ('" . implode("','", $previous_download_ids) . "') LIMIT 1", ARRAY_A);
                    //exit('IM HERE'.$errorcode.'<pre>'.print_r($download_data).'</pre>');
                    if ($download_data != null) {
                        if ($download_data['uniqueid'] == null) {
                            // if the uniqueid is not equal to null, its "valid", regardless of what it is
                            $link = $siteurl . "?downloadid=" . $download_data['id'];
                        } else {
                            $link = $siteurl . "?downloadid=" . $download_data['uniqueid'];
                        }
                        //$order_status= 4;
                    } else {
                        $order_status = $purchase_log['processed'];
                    }
                    $previous_download_ids[] = $download_data['id'];
                }
                do_action('wpsc_confirm_checkout', $purchase_log['id']);
                $shipping = $row['pnp'] * $row['quantity'];
                $total_shipping += $shipping;
                if ($product_data['special'] == 1) {
                    $price_modifier = $product_data['special_price'];
                } else {
                    $price_modifier = 0;
                }
                $total += $row['price'] * $row['quantity'];
                $message_price = nzshpcrt_currency_display($row['price'] * $row['quantity'], $product_data['notax'], true);
                $shipping_price = nzshpcrt_currency_display($shipping, 1, true);
                $variation_values = $wpdb->get_col("SELECT `value_id`  FROM `" . WPSC_TABLE_CART_ITEM_VARIATIONS . "` WHERE `cart_id`='{$row['id']}'");
                //echo "<pre>".print_r($product_data,true)."</pre>";
                $variation_count = count($variation_values);
                if ($purchase['gateway'] != 'testmode') {
//.........这里部分代码省略.........
开发者ID:aeroerin,项目名称:wp-e-commerce-ezp,代码行数:101,代码来源:transaction_result_functions.php


示例9: wpec_transaction_tracking

 function wpec_transaction_tracking($push)
 {
     global $wpdb, $purchlogs, $cart_log_id;
     if (!isset($cart_log_id) || empty($cart_log_id)) {
         return $push;
     }
     $city = $wpdb->get_var("SELECT tf.value\n\t\t                               FROM " . WPSC_TABLE_SUBMITED_FORM_DATA . " tf\n\t\t                          LEFT JOIN " . WPSC_TABLE_CHECKOUT_FORMS . " cf\n\t\t                                 ON cf.id = tf.form_id\n\t\t                              WHERE cf.type = 'city'\n\t\t                                AND log_id = " . $cart_log_id);
     $country = $wpdb->get_var("SELECT tf.value\n\t\t                                  FROM " . WPSC_TABLE_SUBMITED_FORM_DATA . " tf\n\t\t                             LEFT JOIN " . WPSC_TABLE_CHECKOUT_FORMS . " cf\n\t\t                                    ON cf.id = tf.form_id\n\t\t                                 WHERE cf.type = 'country'\n\t\t                                   AND log_id = " . $cart_log_id);
     $cart_items = $wpdb->get_results("SELECT * FROM " . WPSC_TABLE_CART_CONTENTS . " WHERE purchaseid = " . $cart_log_id, ARRAY_A);
     $total_shipping = $purchlogs->allpurchaselogs[0]->base_shipping;
     $total_tax = 0;
     foreach ($cart_items as $item) {
         $total_shipping += $item['pnp'];
         $total_tax += $item['tax_charged'];
     }
     $push[] = "'_addTrans','" . $cart_log_id . "'," . "'" . GA_Filter::ga_str_clean(get_bloginfo('name')) . "'," . "'" . nzshpcrt_currency_display($purchlogs->allpurchaselogs[0]->totalprice, 1, true, false, true) . "'," . "'" . nzshpcrt_currency_display($total_tax, 1, true, false, true) . "'," . "'" . nzshpcrt_currency_display($total_shipping, 1, true, false, true) . "'," . "'" . $city . "'," . "''," . "'" . $country . "'";
     // Country
     foreach ($cart_items as $item) {
         $item['sku'] = $wpdb->get_var("SELECT meta_value FROM " . WPSC_TABLE_PRODUCTMETA . " WHERE meta_key = 'sku' AND product_id = '" . $item['prodid'] . "' LIMIT 1");
         $item['category'] = $wpdb->get_var("SELECT pc.name FROM " . WPSC_TABLE_PRODUCT_CATEGORIES . " pc LEFT JOIN " . WPSC_TABLE_ITEM_CATEGORY_ASSOC . " ca ON pc.id = ca.category_id WHERE pc.group_id = '1' AND ca.product_id = '" . $item['prodid'] . "'");
         $push[] = "'_addItem'," . "'" . $cart_log_id . "'," . "'" . $item['sku'] . "'," . "'" . str_replace("'", "", $item['name']) . "'," . "'" . $item['category'] . "'," . "'" . $item['price'] . "'," . "'" . $item['quantity'] . "'";
         // Item Quantity
     }
     $push[] = "'_trackTrans'";
     return $push;
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:26,代码来源:googleanalytics.php


示例10: wpsc_purchlog_resend_email

/**
 * Purchase log ajax code starts here
*/
function wpsc_purchlog_resend_email()
{
    global $wpdb;
    $siteurl = get_option('siteurl');
    $log_id = $_GET['email_buyer_id'];
    if (is_numeric($log_id)) {
        $selectsql = "SELECT * FROM `" . WPSC_TABLE_PURCHASE_LOGS . "` WHERE `id`= " . $log_id . " LIMIT 1";
        $purchase_log = $wpdb->get_row($selectsql, ARRAY_A);
        if ($purchase_log['gateway'] == "testmode" && $purchase_log['processed'] < 2) {
            $message = get_option("wpsc_email_receipt");
            $message_html = "<h2  style='font-size:16px;font-weight:bold;color:#000;border:0px;padding-top: 0px;' >" . __('Your Order', 'wpsc') . "</h2>";
        } else {
            $message = get_option("wpsc_email_receipt");
            $message_html = $message;
        }
        $order_url = $siteurl . "/wp-admin/admin.php?page=" . WPSC_DIR_NAME . "/display-log.php&amp;purchcaseid=" . $purchase_log['id'];
        $cartsql = "SELECT * FROM `" . WPSC_TABLE_CART_CONTENTS . "` WHERE `purchaseid`=" . $purchase_log['id'] . "";
        $cart = $wpdb->get_results($cartsql, ARRAY_A);
        if ($purchase_log['shipping_country'] != '') {
            $billing_country = $purchase_log['billing_country'];
            $shipping_country = $purchase_log['shipping_country'];
        } else {
            $country = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id`=" . $purchase_log['id'] . " AND `form_id` = '" . get_option('country_form_field') . "' LIMIT 1", ARRAY_A);
            $billing_country = $country[0]['value'];
            $shipping_country = $country[0]['value'];
        }
        $email_form_field = $wpdb->get_results("SELECT `id`,`type` FROM `" . WPSC_TABLE_CHECKOUT_FORMS . "` WHERE `type` IN ('email') AND `active` = '1' ORDER BY `order` ASC LIMIT 1", ARRAY_A);
        $email_address = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_SUBMITED_FORM_DATA . "` WHERE `log_id`=" . $purchase_log['id'] . " AND `form_id` = '" . $email_form_field[0]['id'] . "' LIMIT 1", ARRAY_A);
        $email = $email_address[0]['value'];
        $previous_download_ids = array(0);
        if ($cart != null) {
            foreach ($cart as $row) {
                $link = "";
                $productsql = "SELECT * FROM `" . WPSC_TABLE_PRODUCT_LIST . "` WHERE `id`=" . $row['prodid'] . "";
                $product_data = $wpdb->get_results($productsql, ARRAY_A);
                if ($product_data[0]['file'] > 0) {
                    if ($purchase_log['email_sent'] != 1) {
                        $wpdb->query("UPDATE `" . WPSC_TABLE_DOWNLOAD_STATUS . "` SET `active`='1' WHERE `fileid`='" . $product_data[0]['file'] . "' AND `purchid` = '" . $purchase_log['id'] . "' LIMIT 1");
                    }
                    if ($purchase_log['processed'] >= 2) {
                        $download_data = $wpdb->get_results("SELECT *\r\n\t\t\t\t\t\tFROM `" . WPSC_TABLE_DOWNLOAD_STATUS . "` INNER JOIN `" . WPSC_TABLE_PRODUCT_FILES . "`\r\n\t\t\t\t\t\tON `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`fileid` = `" . WPSC_TABLE_PRODUCT_FILES . "`.`id`\r\n\t\t\t\t\t\tWHERE `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`active`='1'\r\n\t\t\t\t\t\tAND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`purchid`='" . $purchase_log['id'] . "'\r\n\t\t\t\t\t\tAND (\r\n\t\t\t\t\t\t\t`" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`cartid` = '" . $row['id'] . "'\r\n\t\t\t\t\t\t\tOR (\r\n\t\t\t\t\t\t\t\t`" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`cartid` IS NULL\r\n\t\t\t\t\t\t\t\tAND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`fileid` = '{$product_data['file']}'\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\t AND `" . WPSC_TABLE_DOWNLOAD_STATUS . "`.`id` NOT IN ('" . implode("','", $previous_download_ids) . "')", ARRAY_A);
                        $link = array();
                        //exit('IM HERE'.$errorcode.'<pre>'.print_r($download_data).'</pre>');
                        if (sizeof($download_data) != 0) {
                            foreach ($download_data as $single_download) {
                                if ($single_download['uniqueid'] == null) {
                                    // if the uniqueid is not equal to null, its "valid", regardless of what it is
                                    $link[] = array("url" => $siteurl . "?downloadid=" . $single_download['id'], "name" => $single_download["filename"]);
                                } else {
                                    $link[] = array("url" => $siteurl . "?downloadid=" . $single_download['uniqueid'], "name" => $single_download["filename"]);
                                }
                            }
                        }
                        $previous_download_ids[] = $download_data['id'];
                        $order_status = 4;
                    }
                }
                do_action('wpsc_confirm_checkout', $purchase_log['id']);
                $shipping = nzshpcrt_determine_item_shipping($row['prodid'], $row['quantity'], $shipping_country);
                if (isset($_SESSION['quote_shipping'])) {
                    $shipping = $_SESSION['quote_shipping'];
                }
                $total_shipping += $shipping;
                if ($product_data[0]['special'] == 1) {
                    $price_modifier = $product_data[0]['special_price'];
                } else {
                    $price_modifier = 0;
                }
                $total += $row['price'] * $row['quantity'];
                $message_price = nzshpcrt_currency_display($row['price'] * $row['quantity'], $product_data[0]['notax'], true);
                $shipping_price = nzshpcrt_currency_display($shipping, 1, true);
                $variation_sql = "SELECT * FROM `" . WPSC_TABLE_CART_ITEM_VARIATIONS . "` WHERE `cart_id`='" . $row['id'] . "'";
                $variation_data = $wpdb->get_results($variation_sql, ARRAY_A);
                $variation_count = count($variation_data);
                if ($variation_count > 1) {
                    $variation_list = " (";
                    if ($purchase['gateway'] != 'testmode') {
                        if ($gateway['internalname'] == $purch_data[0]['gateway']) {
                            $gateway_name = $gateway['name'];
                        }
                    } else {
                        $gateway_name = "Manual Payment";
                    }
                    $i = 0;
                    foreach ($variation_data as $variation) {
                        if ($i > 0) {
                            $variation_list .= ", ";
                        }
                        $value_id = $variation['value_id'];
                        $value_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_VARIATION_VALUES . "` WHERE `id`='" . $value_id . "' LIMIT 1", ARRAY_A);
                        $variation_list .= $value_data[0]['name'];
                        $i++;
                    }
                    $variation_list .= ")";
                } else {
                    if ($variation_count == 1) {
                        $value_id = $variation_data[0]['value_id'];
//.........这里部分代码省略.........
开发者ID:kasima,项目名称:wp-e-commerce-ezp,代码行数:101,代码来源:ajax-and-init.php


示例11: wpsc_packing_slip


//.........这里部分代码省略.........
                }
            }
        }
        // 			echo "  <tr><td colspan='2'></td></tr>\n\r";
        // 			echo "  <tr><td>".TXT_WPSC_PAYMENT_METHOD.":</td><td>".$gateway_name."</td></tr>\n\r";
        // 			//echo "  <tr><td>".TXT_WPSC_PURCHASE_NUMBER.":</td><td>".$purch_data['id']."</td></tr>\n\r";
        // 			echo "  <tr><td>".TXT_WPSC_HOWCUSTOMERFINDUS.":</td><td>".$purch_data['find_us']."</td></tr>\n\r";
        // 			$engrave_line = explode(",",$purch_data['engravetext']);
        // 			echo "  <tr><td>".TXT_WPSC_ENGRAVE."</td><td></td></tr>\n\r";
        // 			echo "  <tr><td>".TXT_WPSC_ENGRAVE_LINE_ONE.":</td><td>".$engrave_line[0]."</td></tr>\n\r";
        // 			echo "  <tr><td>".TXT_WPSC_ENGRAVE_LINE_TWO.":</td><td>".$engrave_line[1]."</td></tr>\n\r";
        // 			if($purch_data['transactid'] != '') {
        // 				echo "  <tr><td>".TXT_WPSC_TXN_ID.":</td><td>".$purch_data['transactid']."</td></tr>\n\r";
        // 			}
        echo "</table>\n\r";
        echo "<table class='packing_slip'>";
        echo "<tr>";
        echo " <th>" . TXT_WPSC_QUANTITY . " </th>";
        echo " <th>" . TXT_WPSC_NAME . "</th>";
        echo " <th>" . TXT_WPSC_PRICE . " </th>";
        echo " <th>" . TXT_WPSC_SHIPPING . " </th>";
        echo '<th>Tax</th>';
        echo '</tr>';
        $endtotal = 0;
        $all_donations = true;
        $all_no_shipping = true;
        $file_link_list = array();
        foreach ($cart_log as $cart_row) {
            $alternate = "";
            $j++;
            if ($j % 2 != 0) {
                $alternate = "class='alt'";
            }
            $productsql = "SELECT * FROM `" . WPSC_TABLE_PRODUCT_LIST . "` WHERE `id`=" . $cart_row['prodid'] . "";
            $product_data = $wpdb->get_results($productsql, ARRAY_A);
            $variation_sql = "SELECT * FROM `" . WPSC_TABLE_CART_ITEM_VARIATIONS . "` WHERE `cart_id`='" . $cart_row['id'] . "'";
            $variation_data = $wpdb->get_results($variation_sql, ARRAY_A);
            $variation_count = count($variation_data);
            if ($variation_count > 1) {
                $variation_list = " (";
                $i = 0;
                foreach ($variation_data as $variation) {
                    if ($i > 0) {
                        $variation_list .= ", ";
                    }
                    $value_id = $variation['value_id'];
                    $value_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_VARIATION_VALUES . "` WHERE `id`='" . $value_id . "' LIMIT 1", ARRAY_A);
                    $variation_list .= $value_data[0]['name'];
                    $i++;
                }
                $variation_list .= ")";
            } else {
                if ($variation_count == 1) {
                    $value_id = $variation_data[0]['value_id'];
                    $value_data = $wpdb->get_results("SELECT * FROM `" . WPSC_TABLE_VARIATION_VALUES . "` WHERE `id`='" . $value_id . "' LIMIT 1", ARRAY_A);
                    $variation_list = " (" . $value_data[0]['name'] . ")";
                } else {
                    $variation_list = '';
                }
            }
            if ($cart_row['donation'] != 1) {
                $all_donations = false;
            }
            if ($cart_row['no_shipping'] != 1) {
                $shipping = $cart_row['pnp'] * $cart_row['quantity'];
                $total_shipping += $shipping;
                $all_no_shipping = false;
            } else {
                $shipping = 0;
            }
            $price = $cart_row['price'] * $cart_row['quantity'];
            $gst = $price - $price / (1 + $cart_row['gst'] / 100);
            if ($gst > 0) {
                $tax_per_item = $gst / $cart_row['quantity'];
            }
            echo "<tr {$alternate}>";
            echo " <td>";
            echo $cart_row['quantity'];
            echo " </td>";
            echo " <td>";
            echo $product_data[0]['name'];
            echo stripslashes($variation_list);
            echo " </td>";
            echo " <td>";
            echo nzshpcrt_currency_display($price, 1);
            echo " </td>";
            echo " <td>";
            echo nzshpcrt_currency_display($shipping, 1);
            echo " </td>";
            echo '<td>';
            echo nzshpcrt_currency_display($cart_row['tax_charged'], 1);
            echo '<td>';
            echo '</tr>';
        }
        echo "</table>";
        echo "</div>\n\r";
    } else {
        echo "<br />" . TXT_WPSC_USERSCARTWASEMPTY;
    }
}
开发者ID:alx,项目名称:SimplePress,代码行数:101,代码来源:admin-form-functions.php


示例12: wpsc_display_purchlog_totalprice

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nzshpcrt_form_field_list函数代码示例发布时间:2022-05-15
下一篇:
PHP nxt_redirect函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap