本文整理汇总了PHP中WPSC_Countries::get_currency_symbol方法的典型用法代码示例。如果您正苦于以下问题:PHP WPSC_Countries::get_currency_symbol方法的具体用法?PHP WPSC_Countries::get_currency_symbol怎么用?PHP WPSC_Countries::get_currency_symbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPSC_Countries
的用法示例。
在下文中一共展示了WPSC_Countries::get_currency_symbol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpsc_donations
function wpsc_donations($args = null)
{
global $wpdb;
// Args not used yet but this is ready for when it is
$args = wp_parse_args((array) $args, array());
$products = $wpdb->get_results("SELECT DISTINCT `p` . * , `m`.`meta_value` AS `special_price`\n\t\tFROM `" . $wpdb->postmeta . "` AS `m`\n\t\tJOIN `" . $wpdb->posts . "` AS `p` ON `m`.`post_id` = `p`.`ID`\n\t\tWHERE `p`.`post_parent` IN ('0')\n\t\t\tAND `m`.`meta_key` IN ('_wpsc_is_donation')\n\t\t\tAND `m`.`meta_value` IN( '1' )\n\t\tORDER BY RAND( )\n\t\tLIMIT 1", ARRAY_A);
$output = '';
if ($products != null) {
foreach ($products as $product) {
$attached_images = (array) get_posts(array('post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $product['ID'], 'orderby' => 'menu_order', 'order' => 'ASC'));
$attached_image = $attached_images[0];
$output .= "<div class='wpsc_product_donation'>";
if ($attached_image->ID > 0) {
$output .= "<img src='" . wpsc_product_image($attached_image->ID, get_option('product_image_width'), get_option('product_image_height')) . "' title='" . $product['post_title'] . "' alt='" . esc_attr($product['post_title']) . "' /><br />";
}
// Get currency options
$currency_sign_location = get_option('currency_sign_location');
$currency_type = get_option('currency_type');
WPSC_Countries::get_currency_symbol($currency_type);
$price = get_post_meta($product['ID'], '_wpsc_price', true);
// Output
$output .= "<strong>" . $product['post_title'] . "</strong><br />";
$output .= $product['post_content'] . "<br />";
$output .= "<form class='product_form' name='donation_widget_" . $product['ID'] . "' method='post' action='' id='donation_widget_" . $product['ID'] . "'>";
$output .= "<input type='hidden' name='product_id' value='" . $product['ID'] . "'/>";
$output .= "<input type='hidden' name='item' value='" . $product['ID'] . "' />";
$output .= "<input type='hidden' name='wpsc_ajax_action' value='add_to_cart' />";
$output .= "<label for='donation_widget_price_" . $product['ID'] . "'>" . __('Donation', 'wp-e-commerce') . ":</label> {$currency_symbol}<input type='text' id='donation_widget_price_" . $product['ID'] . "' name='donation_price' value='" . esc_attr(number_format($price, 2)) . "' size='6' /><br />";
$output .= "<input type='submit' id='donation_widget_" . $product['ID'] . "_submit_button' name='Buy' class='wpsc_buy_button' value='" . __('Add To Cart', 'wp-e-commerce') . "' />";
$output .= "</form>";
$output .= "</div>";
}
} else {
$output = '';
}
echo $output;
}
示例2: wpsc_get_currency_symbol
/**
* wpsc_get_currency_symbol
* @param does not receive anything
* @return returns the currency symbol used for the shop
*/
function wpsc_get_currency_symbol()
{
$currency_type = get_option('currency_type');
$wpsc_currency_data = WPSC_Countries::get_currency_symbol($currency_type);
return $wpsc_currency_data;
}