当前位置: 首页>>代码示例>>PHP>>正文


PHP fn_format_price函数代码示例

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


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

示例1: printProductRow

 protected function printProductRow($product, $options_variants = array())
 {
     $tbl = '<tr>';
     foreach ($this->selected_fields as $field_name => $active) {
         $tbl .= '<td width="' . $this->price_schema['fields'][$field_name]['min_width'] . '%">';
         if ($field_name == 'image') {
             if (!empty($product['main_pair']) && ($image_data = fn_image_to_display($product['main_pair'], 0, static::IMAGE_HEIGHT))) {
                 $tbl .= '<img src="' . $image_data['image_path'] . '" width= "' . $image_data['width'] . '" height="' . $image_data['height'] . '" alt="">';
             }
         } elseif ($field_name == 'product' && !empty($options_variants)) {
             $options = array();
             foreach ($options_variants as $option_id => $variant_id) {
                 $options[] = htmlspecialchars($product['product_options'][$option_id]['option_name'] . ': ' . $product['product_options'][$option_id]['variants'][$variant_id]['variant_name']);
             }
             $options = implode('<br>', $options);
             $tbl .= htmlspecialchars($product[$field_name]) . '<br>' . $options;
         } elseif ($field_name == 'price') {
             $tbl .= fn_format_price($product[$field_name], CART_PRIMARY_CURRENCY, null, false);
         } else {
             $tbl .= htmlspecialchars($product[$field_name]);
         }
         $tbl .= '</td>';
     }
     $tbl .= '</tr>';
     $this->tbl .= $tbl;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:26,代码来源:Pdf.php

示例2: fn_insurance_calculate_cart

function fn_insurance_calculate_cart(&$cart, $cart_products, $auth, $calculate_shipping, $calculate_taxes, $apply_cart_promotions)
{
    // Set default value
    // [eileen]
    //	if (!isset($cart['is_insurance'])) {
    // 		$cart['is_insurance'] = Registry::get('addons.insurance.enabled_by_default') == 'Y' ? 'Y' : 'N';
    $cart['is_insurance'] = Registry::get('addons.insurance.enabled_by_default') == 'Y' ? 'Y' : (!isset($cart['is_insurance']) ? 'N' : $cart['is_insurance']);
    //	}
    // [/eileen]
    // Set setting from checkbox
    if (isset($_GET['is_insurance'])) {
        if ($_GET['is_insurance'] == 'Y') {
            $cart['is_insurance'] = 'Y';
            fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('insurance_is_on'));
        } elseif ($_GET['is_insurance'] == 'N') {
            $cart['is_insurance'] = 'N';
            fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('insurance_is_off'));
        }
    }
    // Add insurance cost to total
    if ($cart['is_insurance'] == 'Y') {
        $cart['insurance_cost'] = fn_format_price(floatval(Registry::get('addons.insurance.price')));
        $cart['total'] = fn_format_price($cart['total'] + $cart['insurance_cost']);
    }
}
开发者ID:ambient-lounge,项目名称:site,代码行数:25,代码来源:func.php

示例3: fn_mb_adjust_amount

function fn_mb_adjust_amount($price, $payment_currency)
{
    $currencies = Registry::get('currencies');
    if (array_key_exists($payment_currency, $currencies)) {
        if ($currencies[$payment_currency]['is_primary'] != 'Y') {
            $price = fn_format_price($price / $currencies[$payment_currency]['coefficient']);
        }
    } else {
        return false;
    }
    return $price;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:12,代码来源:skrill_func.php

示例4: fn_google_anaylitics_send

function fn_google_anaylitics_send($account, $order_info, $refuse = false)
{
    $url = 'http://www.google-analytics.com/collect';
    $sign = $refuse == true ? '-' : '';
    //Common data which should be sent with any request
    $required_data = array('v' => '1', 'tid' => $account, 'cid' => md5($order_info['email']), 'ti' => $order_info['order_id'], 'cu' => $order_info['secondary_currency']);
    $transaction = array('t' => 'transaction', 'tr' => $sign . $order_info['total'], 'ts' => $sign . $order_info['shipping_cost'], 'tt' => $sign . $order_info['tax_subtotal']);
    $result = Http::get($url, fn_array_merge($required_data, $transaction));
    foreach ($order_info['products'] as $item) {
        $item = array('t' => 'item', 'in' => $item['product'], 'ip' => fn_format_price($item['subtotal'] / $item['amount']), 'iq' => $sign . $item['amount'], 'ic' => $item['product_code'], 'iv' => fn_ga_get_main_category($item['product_id'], $order_info['lang_code']));
        $result = Http::get($url, fn_array_merge($required_data, $item));
    }
}
开发者ID:askzap,项目名称:ultimate,代码行数:13,代码来源:func.php

示例5: fn_exim_google_export_format_price

function fn_exim_google_export_format_price($product_price, $product_id = 0)
{
    static $auth;
    if (empty($auth)) {
        $auth = fn_fill_auth();
    }
    $product = fn_get_product_data($product_id, $auth, CART_LANGUAGE, false, false, false, false, false, false, false);
    fn_promotion_apply('catalog', $product, $auth);
    $_discount = 0;
    if (!empty($product['discount'])) {
        $_discount = $product['discount'];
    }
    return fn_format_price($product_price - $_discount, CART_PRIMARY_CURRENCY, null, false);
}
开发者ID:askzap,项目名称:ultimate,代码行数:14,代码来源:products.functions.php

示例6: getRequestData

 protected function getRequestData()
 {
     $currency_settings = Registry::get('currencies.' . $this->processor_data['processor_params']['currency']);
     if (empty($currency_settings)) {
         $currency_settings = Registry::get('currencies.' . CART_PRIMARY_CURRENCY);
     }
     $timestamp = empty($_REQUEST['timestamp']) ? date('Ymdhis') : $_REQUEST['timestamp'];
     $billing_zipcode = preg_replace("/[^0-9]/", '', $this->order_info['b_zipcode']);
     $billing_address = preg_replace("/[^0-9]/", '', $this->order_info['b_address']);
     $shipping_zipcode = preg_replace("/[^0-9]/", '', $this->order_info['s_zipcode']);
     $shipping_address = preg_replace("/[^0-9]/", '', $this->order_info['s_address']);
     $request_data = array('ORDER_ID' => $this->order_info['order_id'] . $timestamp, 'MERCHANT_ID' => $this->processor_data['processor_params']['merchant_id'], 'ACCOUNT' => $this->processor_data['processor_params']['account'], 'AUTO_SETTLE_FLAG' => (int) ($this->processor_data['processor_params']['settlement'] == 'auto'), 'CURRENCY' => $currency_settings['currency_code'], 'AMOUNT' => fn_format_price($this->order_info['total'] / $currency_settings['coefficient'], $currency_settings['currency_code']) * 100, 'SHIPPING_CO' => $this->order_info['s_country'], 'BILLING_CO' => $this->order_info['b_country'], 'SHIPPING_CODE' => substr($shipping_zipcode, 0, 5) . '|' . substr($shipping_address, 0, 5), 'BILLING_CODE' => substr($billing_zipcode, 0, 5) . '|' . substr($billing_address, 0, 5), 'TIMESTAMP' => $timestamp);
     $request_data['SHA1HASH'] = sha1(strtolower(sha1($request_data['TIMESTAMP'] . '.' . $request_data['MERCHANT_ID'] . '.' . $request_data['ORDER_ID'] . '.' . $request_data['AMOUNT'] . '.' . $request_data['CURRENCY'] . '.' . $this->order_info['payment_info']['card_number'])) . '.' . $this->processor_data['processor_params']['secret_word']);
     return $request_data;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:15,代码来源:realex_remote.php

示例7: fn_google_anaylitics_send

function fn_google_anaylitics_send($account, $order_info, $refuse = false)
{
    $_uwv = '1';
    $url = "http://www.google-analytics.com/__utm.gif";
    $sign = $refuse == true ? '-' : '';
    $cookies = fn_google_analytics_cookies();
    // Transaction request
    // http://www.google-analytics.com/__utm.gif?utmwv=1&utmt=tran&utmn=262780020&utmtid=80&utmtto=3.96&utmttx=0&utmtsp=0.00&utmtci=Boston&utmtrg=MA&utmtco=United%20States&utmac=ASSASAS&utmcc=__utma%3D81851599.2062069588.1182951649.1183008786.1183012376.3%3B%2B__utmb%3D81851599%3B%2B__utmc%3D81851599%3B%2B__utmz%3D81851599.1182951649.1.1.utmccn%3D(direct)%7Cutmcsr%3D(direct)%7Cutmcmd%3D(none)%3B%2B
    $transaction = array('utmwv' => $_uwv, 'utmt' => 'tran', 'utmn' => rand(0, 2147483647), 'utmtid' => $order_info['order_id'], 'utmtto' => $sign . $order_info['total'], 'utmttx' => $order_info['tax_subtotal'], 'utmtsp' => $order_info['shipping_cost'], 'utmtci' => $order_info['b_city'], 'utmtrg' => $order_info['b_state'], 'utmtco' => $order_info['b_country_descr'], 'utmac' => $account, 'utmcc' => $cookies);
    list(, $result) = fn_http_request('GET', $url, $transaction);
    // Items request
    //http://www.google-analytics.com/__utm.gif?utmwv=1&utmt=item&utmn=812678190&utmtid=80&utmipc=B00078MG5M&utmipn=100%25%20Cotton%20Adult%2FYouth%20Beefy%20T-Shirt%20by%20Hanes%20(Style%23%205180)&utmipr=4.50&utmiqt=1&utmac=ASSASAS&utmcc=
    foreach ($order_info['items'] as $item) {
        $cat_id = db_get_field("SELECT category_id FROM ?:products_categories WHERE product_id = ?i AND link_type = 'M'", $item['product_id']);
        $i = array('utmwv' => $_uwv, 'utmt' => 'item', 'utmn' => rand(0, 2147483647), 'utmtid' => $order_info['order_id'], 'utmipc' => $item['product_code'], 'utmipn' => $item['product'], 'utmiva' => fn_get_category_name($cat_id, $order_info['lang_code']), 'utmipr' => $sign . fn_format_price($item['subtotal'] / $item['amount']), 'utmiqt' => $item['amount'], 'utmac' => $account, 'utmcc' => $cookies);
        list(, $result) = fn_http_request('GET', $url, $i);
    }
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:18,代码来源:func.php

示例8: fn_finish_payment

    }
    fn_finish_payment($_REQUEST['order_id'], $pp_response);
    fn_order_placement_routines('route', $_REQUEST['order_id']);
    exit;
} else {
    $order_prefix = !empty($processor_data['processor_params']['order_prefix']) ? $processor_data['processor_params']['order_prefix'] : '';
    $return_url = fn_url("payment_notification.notify?payment=eway_shared&order_id={$order_id}", AREA, 'current');
    $MerchantInvoice = $order_prefix . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id);
    if ($processor_data['processor_params']['gateway'] == 'payment') {
        $currency = 'GBP';
    } elseif ($processor_data['processor_params']['gateway'] == 'nz') {
        $currency = 'NZD';
    } else {
        $currency = 'AUD';
    }
    $request_url = 'https://' . $processor_data['processor_params']['gateway'] . '.ewaygateway.com/Request/?' . 'CustomerID=' . $processor_data['processor_params']['customer_id'] . '&UserName=' . $processor_data['processor_params']['username'] . '&Amount=' . fn_format_price($order_info['total'], $currency, 2, false) . '&Currency=' . $currency . '&ReturnURL=' . urlencode($return_url) . '&CancelURL=' . urlencode($return_url) . '&InvoiceDescription=' . (!empty($order_info['notice']) ? $order_info['notice'] : '') . '&CompanyName=' . urlencode(Registry::get('settings.Company.company_name')) . '&CustomerFirstName=' . urlencode($order_info['b_firstname']) . '&CustomerLastName=' . urlencode($order_info['b_lastname']) . '&CustomerAddress=' . urlencode($order_info['b_address']) . '&CustomerCity=' . urlencode($order_info['b_city']) . '&CustomerState=' . urlencode($order_info['b_state_descr']) . '&CustomerPostCode=' . urlencode($order_info['b_zipcode']) . '&CustomerCountry=' . urlencode($order_info['b_country_descr']) . '&CustomerPhone=' . urlencode($order_info['phone']) . '&CustomerEmail=' . urlencode($order_info['email']) . '&MerchantReference=' . urlencode($MerchantInvoice);
    $return = Http::get($request_url);
    $sucessfull = 'False';
    if (preg_match("/<Result>(.*)<\\/Result>/", $return, $matches)) {
        $sucessfull = $matches[1];
    }
    if ($sucessfull == 'True') {
        if (preg_match("/<URI>(.*)<\\/URI>/", $return, $matches)) {
            fn_create_payment_form($matches[1], array(), '', true, 'get');
        }
    } else {
        if (preg_match("/<Error>(.*)<\\/Error>/", $return, $matches)) {
            $pp_response['reason_text'] = $matches[1];
        }
        $pp_response['order_status'] = 'D';
    }
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:eway_shared.php

示例9: fn_buy_together_calculate_discount

function fn_buy_together_calculate_discount($price, $modifier = 0, $modifier_type = 'to_fixed')
{
    $discount = 0;
    switch ($modifier_type) {
        case 'to_fixed':
            $discount = $price - $modifier;
            break;
        case 'by_fixed':
            $discount = $modifier;
            break;
        case 'to_percentage':
            $discount = $price - $price / 100 * $modifier;
            break;
        case 'by_percentage':
            $discount = $price / 100 * $modifier;
            break;
    }
    if ($discount > $price) {
        $discount = $price;
    }
    $discount = fn_format_price($discount);
    $discounted_price = $price - $discount;
    return array($discount, $discounted_price);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:24,代码来源:func.php

示例10: fn_rma_recalculate_order

function fn_rma_recalculate_order($order_id, $recalculate_type, $return_id, $is_refund, $ex_data)
{
    if (empty($recalculate_type) || empty($return_id) || empty($order_id) || !is_array($ex_data) || $recalculate_type == 'M' && !isset($ex_data['total'])) {
        return false;
    }
    $order = db_get_row("SELECT total, subtotal, discount, shipping_cost, status FROM ?:orders WHERE order_id = ?i", $order_id);
    $order_items = db_get_hash_array("SELECT * FROM ?:order_details WHERE ?:order_details.order_id = ?i", 'item_id', $order_id);
    $additional_data = db_get_hash_single_array("SELECT type, data FROM ?:order_data WHERE order_id = ?i", array('type', 'data'), $order_id);
    $order_return_info = @unserialize(@$additional_data[ORDER_DATA_RETURN]);
    $order_tax_info = @unserialize(@$additional_data['T']);
    $status_order = $order['status'];
    unset($order['status']);
    if ($recalculate_type == 'R') {
        $product_groups = @unserialize(@$additional_data['G']);
        if ($is_refund == 'Y') {
            $sign = $ex_data['inventory_to'] == 'I' ? -1 : 1;
            // What for is this section ???
            if (!empty($order_return_info['returned_products'])) {
                foreach ($order_return_info['returned_products'] as $item_id => $item) {
                    if (isset($item['extra']['returns'][$return_id])) {
                        $r_item = $o_item = $item;
                        unset($r_item['extra']['returns'][$return_id]);
                        $r_item['amount'] = $item['amount'] - $item['extra']['returns'][$return_id]['amount'];
                        fn_rma_recalculate_order_routine($order, $r_item, $item, 'O-', $ex_data);
                        if (empty($r_item['amount'])) {
                            unset($order_return_info['returned_products'][$item_id]);
                        } else {
                            $order_return_info['returned_products'][$item_id] = $r_item;
                        }
                        $o_item['primordial_amount'] = (isset($order_items[$item_id]) ? $order_items[$item_id]['amount'] : 0) + $item['extra']['returns'][$return_id]['amount'];
                        $o_item['primordial_discount'] = @$o_item['extra']['discount'];
                        fn_rma_recalculate_order_routine($order, $o_item, $item, 'M+', $ex_data);
                        $o_item['amount'] = (isset($order_items[$item_id]) ? $order_items[$item_id]['amount'] : 0) + $item['extra']['returns'][$return_id]['amount'];
                        if (isset($order_items[$item_id]['extra'])) {
                            $o_item['extra'] = @unserialize($order_items[$item_id]['extra']);
                        }
                        $o_item['extra']['returns'][$return_id] = $item['extra']['returns'][$return_id];
                        $o_item['extra'] = serialize($o_item['extra']);
                        if (!isset($order_items[$item_id])) {
                            db_query("REPLACE INTO ?:order_details ?e", $o_item);
                        } else {
                            db_query("UPDATE ?:order_details SET ?u WHERE item_id = ?i AND order_id = ?i", $o_item, $item_id, $order_id);
                        }
                    }
                }
            }
            // Check all the products and update their amount and cost.
            foreach ($order_items as $item_id => $item) {
                $item['extra'] = @unserialize($item['extra']);
                if (isset($item['extra']['returns'][$return_id])) {
                    $o_item = $item;
                    $o_item['amount'] = $o_item['amount'] + $sign * $item['extra']['returns'][$return_id]['amount'];
                    unset($o_item['extra']['returns'][$return_id]);
                    if (empty($o_item['extra']['returns'])) {
                        unset($o_item['extra']['returns']);
                    }
                    fn_rma_recalculate_order_routine($order, $o_item, $item, '', $ex_data);
                    if (empty($o_item['amount'])) {
                        db_query("DELETE FROM ?:order_details WHERE item_id = ?i AND order_id = ?i", $item_id, $order_id);
                    } else {
                        $o_item['extra'] = serialize($o_item['extra']);
                        db_query("UPDATE ?:order_details SET ?u WHERE item_id = ?i AND order_id = ?i", $o_item, $item_id, $order_id);
                    }
                    if (!isset($order_return_info['returned_products'][$item_id])) {
                        $r_item = $item;
                        unset($r_item['extra']['returns']);
                        $r_item['amount'] = $item['extra']['returns'][$return_id]['amount'];
                    } else {
                        $r_item = $order_return_info['returned_products'][$item_id];
                        $r_item['amount'] = $r_item['amount'] + $item['extra']['returns'][$return_id]['amount'];
                    }
                    fn_rma_recalculate_order_routine($order, $r_item, $item, 'M-O+', $ex_data);
                    $r_item['extra']['returns'][$return_id] = $item['extra']['returns'][$return_id];
                    $order_return_info['returned_products'][$item_id] = $r_item;
                    fn_rma_update_order_taxes($order_tax_info, $item_id, $item['amount'], $o_item['amount'], $order);
                }
            }
            $_ori_data = array('order_id' => $order_id, 'type' => ORDER_DATA_RETURN, 'data' => $order_return_info);
        }
        $shipping_info = array();
        if ($product_groups) {
            $_total = 0;
            foreach ($product_groups as $key_group => $group) {
                if (isset($group['chosen_shippings'])) {
                    foreach ($group['chosen_shippings'] as $key_shipping => $shipping) {
                        $_total += $shipping['rate'];
                    }
                }
            }
            foreach ($product_groups as $key_group => $group) {
                if (isset($group['chosen_shippings'])) {
                    foreach ((array) $ex_data['shipping_costs'] as $shipping_id => $cost) {
                        foreach ($group['chosen_shippings'] as $key_shipping => $shipping) {
                            $shipping_id = $shipping['shipping_id'];
                            $product_groups[$key_group]['chosen_shippings'][$key_shipping]['rate'] = fn_format_price($_total ? $shipping['rate'] / $_total * $cost : $cost / count($product_groups));
                            $product_groups[$key_group]['shippings'][$shipping_id]['rate'] = fn_format_price($_total ? $shipping['rate'] / $_total * $cost : $cost / count($product_groups));
                            if (empty($shipping_info[$shipping_id])) {
                                $shipping_info[$shipping_id] = $product_groups[$key_group]['shippings'][$shipping_id];
                            }
                            $shipping_info[$shipping_id]['rates'][$key_group] = $product_groups[$key_group]['shippings'][$shipping_id]['rate'];
//.........这里部分代码省略.........
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:101,代码来源:func.php

示例11: offer

 protected function offer($product)
 {
     $yml_data = array();
     $offer_attrs = '';
     $market_categories = $this->getMarketCategories();
     if (!empty($product['yml_bid'])) {
         $offer_attrs .= '@bid=' . $product['yml_bid'];
     }
     if (!empty($product['yml_cbid'])) {
         $offer_attrs .= '@cbid=' . $product['yml_cbid'];
     }
     $price_fields = array('price', 'yml_cost', 'list_price', 'base_price');
     $currency_data = Registry::get('currencies.' . CART_PRIMARY_CURRENCY);
     foreach ($price_fields as $field) {
         $product[$field] = fn_format_price($product[$field], $currency_data['currency_code'], $currency_data['decimals'], false);
     }
     if (CART_PRIMARY_CURRENCY != "RUB" && CART_PRIMARY_CURRENCY != "UAH" && CART_PRIMARY_CURRENCY != "BYR" && CART_PRIMARY_CURRENCY != "KZT") {
         $currencies = Registry::get('currencies');
         if (isset($currencies['RUB'])) {
             $currency = $currencies['RUB'];
         } elseif (isset($currencies['UAH'])) {
             $currency = $currencies['UAH'];
         } elseif (isset($currencies['BYR'])) {
             $currency = $currencies['BYR'];
         } elseif (isset($currencies['KZT'])) {
             $currency = $currencies['KZT'];
         }
         if (!empty($currency)) {
             foreach ($price_fields as $field) {
                 $product[$field] = fn_format_rate_value($product[$field], 'F', $currency['decimals'], '.', '', $currency['coefficient']);
             }
         }
     }
     foreach ($price_fields as $field) {
         if (empty($product[$field])) {
             $product[$field] = floatval($product[$field]) ? $product[$field] : fn_parse_price($product[$field]);
         }
     }
     $yml_data['url'] = $product['product_url'];
     $yml_data['price'] = !empty($product['price']) ? $product['price'] : "0.00";
     if (!empty($product['base_price']) && $product['price'] < $product['base_price'] * 0.95) {
         $yml_data['oldprice'] = $product['base_price'];
     } elseif (!empty($product['list_price']) && $product['price'] < $product['list_price'] * 0.95) {
         $yml_data['oldprice'] = $product['list_price'];
     }
     $yml_data['currencyId'] = !empty($currency) ? $currency['currency_code'] : CART_PRIMARY_CURRENCY;
     $yml_data['categoryId'] = $product['category_id'];
     if ($this->options['market_category'] == "Y") {
         if ($this->options['market_category_object'] == "category" && isset($market_categories[$product['category_id']])) {
             $yml_data['market_category'] = $market_categories[$product['category_id']];
         } elseif ($this->options['market_category_object'] == "product" && !empty($product['yml_market_category'])) {
             $yml_data['market_category'] = $product['yml_market_category'];
         }
     }
     // Images
     $picture_index = 0;
     while ($image = array_shift($product['images'])) {
         $key = 'picture';
         if ($picture_index) {
             $key .= '+' . $picture_index;
         }
         $yml_data[$key] = $this->getImageUrl($image);
         $picture_index++;
     }
     $yml_data['store'] = $product['yml_store'] == 'Y' ? 'true' : 'false';
     $yml_data['pickup'] = $product['yml_pickup'] == 'Y' ? 'true' : 'false';
     $yml_data['delivery'] = $product['yml_delivery'] == 'Y' ? 'true' : 'false';
     if ($product['yml_adult'] == 'Y') {
         $yml_data['adult'] = 'true';
     }
     if ($this->options['local_delivery_cost'] == "Y") {
         $yml_data['local_delivery_cost'] = $product['yml_cost'] == 0 ? '0' : $product['yml_cost'];
     }
     $type = '';
     if ($this->options['export_type'] == 'vendor_model') {
         $type = '@type=vendor.model';
         if ($this->options['type_prefix'] == "Y") {
             if (!empty($product['yml_type_prefix'])) {
                 $yml_data['typePrefix'] = $product['yml_type_prefix'];
             } else {
                 $yml_data['typePrefix'] = $product['category'];
             }
         }
         $yml_data['vendor'] = $product['brand'];
         if ($this->options['export_vendor_code'] == 'Y') {
             $vendor_code = $this->getVendorCode($product);
             if (!empty($vendor_code)) {
                 $yml_data['vendorCode'] = $vendor_code;
             }
         }
         $yml_data['model'] = !empty($product['yml_model']) ? $product['yml_model'] : '';
     } elseif ($this->options['export_type'] == 'simple') {
         $yml_data['name'] = $product['product'];
         if (!empty($product['brand'])) {
             $yml_data['vendor'] = $product['brand'];
         }
         if ($this->options['export_vendor_code'] == 'Y') {
             $vendor_code = $this->getVendorCode($product);
             if (!empty($vendor_code)) {
                 $yml_data['vendorCode'] = $vendor_code;
//.........这里部分代码省略.........
开发者ID:askzap,项目名称:ask-zap,代码行数:101,代码来源:Yml.php

示例12: _getBaseItemData

    private function _getBaseItemData($product, $template, $images_data)
    {
        $currency = CART_PRIMARY_CURRENCY;
        $shippings = $this->prepareShipping($product, $template);
        $company = fn_get_company_placement_info(Registry::get('runtime.company_id'));
        $price = fn_format_price($product['price']);
        $picture_details = '';
        if ($product['override'] == "Y") {
            $title = substr(strip_tags($product['ebay_title']), 0, 80);
            $description = !empty($product['ebay_description']) ? $product['ebay_description'] : $product['full_description'];
        } else {
            $title = substr(strip_tags($product['product']), 0, 80);
            $description = $product['full_description'];
        }
        $payments = '<PaymentMethods>' . implode("</PaymentMethods>\n<PaymentMethods>", $template['payment_methods']) . '</PaymentMethods>';
        if (in_array('PayPal', $template['payment_methods'])) {
            $payments .= "\n<PayPalEmailAddress>{$template['paypal_email']}</PayPalEmailAddress>";
        }
        if (!empty($product['main_pair']) && !empty($product['main_pair']['detailed']) && !empty($product['main_pair']['detailed']['http_image_path']) && $images_data[md5($product['main_pair']['detailed']['http_image_path'])]) {
            $image_url = $images_data[md5($product['main_pair']['detailed']['http_image_path'])];
            $picture_details .= "<PictureURL>{$image_url}</PictureURL>\n";
        }
        if ($product['image_pairs']) {
            foreach ($product['image_pairs'] as $image_pair) {
                if (!empty($images_data[md5($image_pair['detailed']['http_image_path'])])) {
                    $image_url = $images_data[md5($image_pair['detailed']['http_image_path'])];
                    $picture_details .= "<PictureURL>{$image_url}</PictureURL>\n";
                }
            }
        }
        $picture_details = empty($picture_details) ? '' : "<PictureDetails>\n{$picture_details}</PictureDetails>";
        $product_features = '';
        if (!empty($product['product_features'])) {
            $product_features = '<ItemSpecifics>' . fn_prepare_xml_product_features($product['product_features']) . '</ItemSpecifics>';
        }
        $product_options = '';
        $start_price = '';
        $product_quantity = '';
        $inventory_combinations = db_get_array("SELECT combination FROM ?:product_options_inventory WHERE product_id = ?i AND amount > 0 AND combination != ''", $product['product_id']);
        if (!empty($product['product_options']) && !empty($inventory_combinations)) {
            $params = array('page' => 1, 'product_id' => $product['product_id']);
            $product_options = '<Variations>' . fn_prepare_xml_product_options($params, $product, $images_data) . '</Variations>';
        }
        if (empty($product_options)) {
            $start_price = '<StartPrice currencyID="' . $currency . '">' . $price . '</StartPrice>';
            $product_quantity = '<Quantity>' . $product['amount'] . '</Quantity>';
        }
        $location = fn_get_country_name($company['company_country']);
        $xml = <<<EOT
<ItemID>{$product['ebay_item_id']}</ItemID>
<Site>{$template['site']}</Site>
<ListingType>FixedPriceItem</ListingType>
<Currency>{$currency}</Currency>
<PrimaryCategory>
<CategoryID>{$template['category']}</CategoryID>
</PrimaryCategory>
<SecondaryCategory>
<CategoryID>{$template['sec_category']}</CategoryID>
</SecondaryCategory>
<ConditionID>{$template['condition_id']}</ConditionID>
<CategoryMappingAllowed>true</CategoryMappingAllowed>
<Country>{$company['company_country']}</Country>
<PostalCode>{$company['company_zipcode']}</PostalCode>
<Location>{$location}</Location>
<Title><![CDATA[{$title}]]></Title>
<Description><![CDATA[{$description}]]></Description>
{$payments}
<ListingDuration>{$template['ebay_duration']}</ListingDuration>
<DispatchTimeMax>{$template['dispatch_days']}</DispatchTimeMax>
{$shippings}
{$picture_details}
{$product_features}
{$product_options}
{$start_price}
{$product_quantity}
EOT;
        return $xml;
    }
开发者ID:ambient-lounge,项目名称:site,代码行数:78,代码来源:Ebay.php

示例13: content_55db8f57a02b71_27074353


//.........这里部分代码省略.........
</a>
        <div class="product-code">
            <span class="product-code-label row-status"><?php 
                echo $_smarty_tpl->__("sku");
                ?>
 </span>
            <input type="text" name="products_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                ?>
][product_code]" size="15" maxlength="32" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_code'], ENT_QUOTES, 'UTF-8');
                ?>
" class="input-hidden span2" />
        </div>
        <?php 
                echo $_smarty_tpl->getSubTemplate("views/companies/components/company_name.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('object' => $_smarty_tpl->tpl_vars['product']->value), 0);
                ?>

    </td>
    <td class="<?php 
                if ($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['no_hide_input_if_shared_product']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
">
        <?php 
                echo $_smarty_tpl->getSubTemplate("buttons/update_for_all.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('display' => $_smarty_tpl->tpl_vars['show_update_for_all']->value, 'object_id' => "price_" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'name' => "update_all_vendors[price][" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'] . "]"), 0);
                ?>

        <input type="text" name="products_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                ?>
][price]" size="6" value="<?php 
                echo htmlspecialchars(fn_format_price($_smarty_tpl->tpl_vars['product']->value['price'], $_smarty_tpl->tpl_vars['primary_currency']->value, null, false), ENT_QUOTES, 'UTF-8');
                ?>
" class="input-mini input-hidden"/>
    </td>
    <td>
        <input type="text" name="products_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                ?>
][list_price]" size="6" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['list_price'], ENT_QUOTES, 'UTF-8');
                ?>
" class="input-mini input-hidden" /></td>
    <?php 
                if ($_smarty_tpl->tpl_vars['search']->value['order_ids']) {
                    ?>
    <td><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['purchased_qty'], ENT_QUOTES, 'UTF-8');
                    ?>
</td>
    <td><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['purchased_subtotal'], ENT_QUOTES, 'UTF-8');
                    ?>
</td>
    <?php 
                }
                ?>
    <td>
        <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['tracking'] == smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("edit"), 'but_href' => "product_options.inventory?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'but_role' => "edit"), 0);
                    ?>
开发者ID:AlanIsrael0,项目名称:market,代码行数:67,代码来源:c0ea1450969548284ad3899a8da6a8cfa089b6b7.tygh.manage.tpl.php

示例14: unset

         unset($_SESSION['thaiepay_refno']);
     } else {
         if ($mode == 'finish') {
             fn_order_placement_routines('checkout_redirect');
         }
         exit;
     }
 }
 $order_id = intval($_REQUEST['refno']);
 if (fn_check_payment_script('thaiepay.php', $order_id, $processor_data)) {
     if ($mode == 'notify') {
         $errors = array();
         $errors_desc = array('additional_parameter' => __('additional_parameter_not_correct'), 'total' => __('order_total_not_correct'));
         if (isset($_REQUEST['total'])) {
             $order_info = fn_get_order_info($order_id);
             if (fn_format_price($order_info['total']) != fn_format_price($_REQUEST['total'])) {
                 $errors['total'] = true;
             }
         }
         $param_name = !empty($processor_data['processor_params']['add_param_name']) ? $processor_data['processor_params']['add_param_name'] : '';
         $param_value = !empty($processor_data['processor_params']['add_param_value']) ? $processor_data['processor_params']['add_param_value'] : '';
         $sec_param = !empty($param_name) && !empty($_REQUEST[$param_name]) ? $_REQUEST[$param_name] : '';
         if (empty($param_value) || empty($sec_param) || $sec_param != $param_value) {
             $errors['additional_parameter'] = true;
         }
         $pp_response = array();
         $pp_response['reason_text'] = __('order_id') . '-' . $order_id;
         $pp_response['transaction_id'] = '';
         if ($errors) {
             $pp_response['order_status'] = 'F';
             foreach ($errors as $error => $v) {
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:thaiepay.php

示例15: foreach

 if (!empty($order_info['use_gift_certificates'])) {
     foreach ($order_info['use_gift_certificates'] as $gc_code => $gc_data) {
         $amount = fn_format_price($gc_data['amount']) * 100 * -1;
         $post_data['itemNumber' . $counter] = $gc_data['gift_cert_id'];
         $post_data['itemDescription' . $counter] = $gc_code;
         $post_data['itemQuantity' . $counter] = 1;
         $post_data['itemPrice' . $counter] = $amount;
         $counter++;
     }
 }
 // Taxes
 if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') != 'unit_price') {
     $msg = __('tax');
     foreach ($order_info['taxes'] as $tax_id => $tax_data) {
         if ($tax_data['price_includes_tax'] == 'N') {
             $amount = fn_format_price($tax_data['tax_subtotal']) * 100;
             $post_data['itemNumber' . $counter] = $tax_id;
             $post_data['itemDescription' . $counter] = $msg;
             $post_data['itemQuantity' . $counter] = 1;
             $post_data['itemPrice' . $counter] = $amount;
             $counter++;
         }
     }
 }
 // Shipping
 $shipping = $order_info['shipping_cost'];
 if ($shipping > 0) {
     $ship = $order_info['shipping_cost'] * 100;
     $post_data['itemNumber' . $counter] = 'SH';
     $post_data['itemDescription' . $counter] = 'Shipping';
     $post_data['itemQuantity' . $counter] = 1;
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:ideal_basic.php


注:本文中的fn_format_price函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。