本文整理汇总了PHP中wpsc_the_product_price_display函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsc_the_product_price_display函数的具体用法?PHP wpsc_the_product_price_display怎么用?PHP wpsc_the_product_price_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpsc_the_product_price_display函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
//.........这里部分代码省略.........
<h4>
<a href="<?php
the_permalink();
?>
" class="nav-button" rel="bookmark" title="Click to learn more about <?php
the_title();
?>
"><?php
the_title();
?>
</a>
</h4>
<?php
if ($show_date || $show_comments) {
?>
<div class="recent-posts-entry-meta">
<?php
if ($show_date) {
?>
<div class="post-date"><?php
the_time('F jS, Y');
?>
<span class="post-author"> by <?php
the_author_posts_link();
?>
</span></div>
<?php
}
// Post Date & Author
?>
<?php
if ($show_comments) {
?>
<div class="comments-qty"><?php
comments_popup_link('No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post');
?>
</div>
<?php
}
// Post Comments
?>
</div>
<?php
}
?>
<?php
if ($show_excerpt) {
?>
<div class="recent-posts-entry-content"><?php
the_excerpt();
?>
<a href="<?php
the_permalink();
?>
" class="more-link" rel="bookmark" title="Read more about <?php
the_title();
?>
"><?php
echo $excerpt_more;
?>
</a>
</div>
<?php
}
// Post Content
?>
<?php
if ($show_price && $post_type != 'product') {
continue;
} else {
if ($post_type === 'product') {
echo '<div class="product-price">';
woocommerce_template_single_price();
echo '</div>';
// Product Price if WOO
} elseif ($post_type === 'wpsc-product') {
echo '<div class="product-price">';
wpsc_the_product_price_display();
echo '</div>';
// Product Price if WPEC
} else {
continue;
}
}
?>
</li>
<?php
}
echo '</ul>';
echo $after_widget;
wp_reset_postdata();
}
开发者ID:binq2,项目名称:borealpaddle,代码行数:101,代码来源:class-pt-widget-recent-posts.php
示例2: the_title
?>
">
<p><?php
the_title();
?>
</p>
</a>
<?php
if (wpsc_product_is_donation()) {
?>
<h4>Donation</h4>
<?php
} else {
?>
<h4><?php
wpsc_the_product_price_display();
?>
</h4>
<!-- multi currency code -->
<?php
if (wpsc_product_has_multicurrency()) {
?>
<h4><?php
echo wpsc_display_product_multicurrency();
?>
</h4>
<?php
}
?>
<?php
}
开发者ID:samtripp,项目名称:emporium-theme,代码行数:31,代码来源:page-products.php
示例3: vtprd_the_product_price_display
/**
*****************************
*** FOR WPEC VERSION 3.9+ ***
*****************************
COPIED FROM WPSC-INCLUDES/PRODUCT-TEMPLATE.PHP WPEC VERSION 3.8.10
* WPSC The Product Price Display
*
* @param $args (array) Array of args.
* @return (string) HTML formatted prices
*
* @uses apply_filters() Calls 'wpsc_the_product_price_display_old_price_class' passing class and product ID
* @uses apply_filters() Calls 'wpsc_the_product_price_display_old_price_amount_class' passing class and product ID
* @uses apply_filters() Calls 'wpsc_the_product_price_display_price_class' passing class and product ID
* @uses apply_filters() Calls 'wpsc_the_product_price_display_price_amount_class' passing class and product ID
* @uses apply_filters() Calls 'wpsc_the_product_price_display_you_save_class' passing class and product ID
* @uses apply_filters() Calls 'wpsc_the_product_price_display_you_save_amount_class' passing class and product ID
* @uses wpsc_product_normal_price() Get the normal price
* @uses wpsc_the_product_price() Get the current price
* @uses wpsc_you_save() Get pricing saving
* @uses wpsc_product_on_special() Is product on sale?
* @uses wpsc_product_has_variations() Checks if product has variations
* @uses wpsc_product_variation_price_from() Gets the lowest variation price
* @uses wpsc_currency_display() Display price as currency
*/
function vtprd_the_product_price_display($args = array())
{
global $vtprd_info, $vtprd_setup_options;
if (empty($args['id'])) {
$id = get_the_ID();
} else {
$id = (int) $args['id'];
}
//-+--+-+-+-+-+-+-+-+-+-+-++--+-+-+-+-+-+-+-+-+-+-++--+-+-+-+-+-+-+-+-+-+-+
// if $id is a variation and has a parent, sent the PARENT!!!
//gets all of the info we need and puts it into 'product_session_info'
vtprd_get_product_session_info($id);
//-+--+-+-+-+-+-+-+-+-+-+-++--+-+-+-+-+-+-+-+-+-+-++--+-+-+-+-+-+-+-+-+-+-+
// if $id is a variation, refigure product_yousave_total_amt!!
//refigure yousave amts for WPEC
if (VTPRD_PARENT_PLUGIN_NAME == 'WP E-Commerce') {
vtprd_WPEC_recompute_theme_amts();
}
//if we have no yousave amt, do the default routine and exit
if ($vtprd_info['product_session_info']['product_yousave_total_amt'] == 0) {
wpsc_the_product_price_display($args);
return;
}
$defaults = array('id' => $id, 'old_price_text' => __('Old Price: %s', 'wpsc'), 'price_text' => __('Price: %s', 'wpsc'), 'you_save_text' => __('You save: %s', 'wpsc'), 'old_price_class' => 'pricedisplay wpsc-product-old-price ' . $id, 'old_price_before' => '<p %s>', 'old_price_after' => '</p>', 'old_price_amount_id' => 'old_product_price_' . $id, 'old_price_amount_class' => 'oldprice', 'old_price_amount_before' => '<span class="%1$s" id="%2$s">', 'old_price_amount_after' => '</span>', 'price_amount_id' => 'product_price_' . $id, 'price_class' => 'pricedisplay wpsc-product-price ' . $id, 'price_before' => '<p %s>', 'price_after' => '</p>', 'price_amount_class' => 'currentprice pricedisplay ' . $id, 'price_amount_before' => '<span class="%1$s" id="%2$s">', 'price_amount_after' => '</span>', 'you_save_class' => 'pricedisplay wpsc-product-you-save product_' . $id, 'you_save_before' => '<p %s>', 'you_save_after' => '</p>', 'you_save_amount_id' => 'yousave_' . $id, 'you_save_amount_class' => 'yousave', 'you_save_amount_before' => '<span class="%1$s" id="%2$s">', 'you_save_amount_after' => '</span>', 'output_price' => true, 'output_old_price' => true, 'output_you_save' => true);
$r = wp_parse_args($args, $defaults);
extract($r);
$amt = $vtprd_info['product_session_info']['product_list_price'];
$amt = vtprd_format_money_element($amt);
$old_price = $amt;
$amt = $vtprd_info['product_session_info']['product_yousave_total_amt'];
$amt = vtprd_format_money_element($amt);
$you_save = $amt . '! (' . $vtprd_info['product_session_info']['product_yousave_total_pct'] . '%)';
$you_save_percentage = $vtprd_info['product_session_info']['product_yousave_total_pct'];
// if the product has no variations, these amounts are straight forward...
// $old_price = wpsc_product_normal_price( $id );
$current_price = wpsc_the_product_price(false, false, $id);
// $you_save = wpsc_you_save( 'type=amount' ) . '! (' . wpsc_you_save() . '%)';
// $you_save_percentage = wpsc_you_save();
// $show_old_price = $show_you_save = wpsc_product_on_special( $id );
/*
// but if the product has variations and at least one of the variations is on special, we have
// a few edge cases...
if ( wpsc_product_has_variations( $id ) && wpsc_product_on_special( $id ) ) {
// generally it doesn't make sense to display "you save" amount unless the user has selected
// a specific variation
$show_you_save = false;
$old_price_number = wpsc_product_variation_price_from( $id, array( 'only_normal_price' => true ) );
$current_price_number = wpsc_product_variation_price_from( $id );
// if coincidentally, one of the variations are not on special, but its price is equal to
// or lower than the lowest variation sale price, old price should be hidden, and current
// price should reflect the "normal" price, not the sales price, to avoid confusion
if ( $old_price_number == $current_price_number ) {
$show_old_price = false;
$current_price = wpsc_product_normal_price( $id );
}
}
*/
// replace placeholders in arguments with correct values
$old_price_class = apply_filters('wpsc_the_product_price_display_old_price_class', $old_price_class, $id);
$old_price_amount_class = apply_filters('wpsc_the_product_price_display_old_price_amount_class', $old_price_amount_class, $id);
$attributes = 'class="' . esc_attr($old_price_class) . '"';
// if ( ! $show_old_price )
// $attributes .= ' style="display:none;"';
$old_price_before = sprintf($old_price_before, $attributes);
$old_price_amount_before = sprintf($old_price_amount_before, esc_attr($old_price_amount_class), esc_attr($old_price_amount_id));
$price_class = 'class="' . esc_attr(apply_filters('wpsc_the_product_price_display_price_class', esc_attr($price_class), $id)) . '"';
$price_amount_class = apply_filters('wpsc_the_product_price_display_price_amount_class', esc_attr($price_amount_class), $id);
$price_before = sprintf($price_before, $price_class);
$price_amount_before = sprintf($price_amount_before, esc_attr($price_amount_class), esc_attr($price_amount_id));
$you_save_class = apply_filters('wpsc_the_product_price_display_you_save_class', $you_save_class, $id);
$you_save_amount_class = apply_filters('wpsc_the_product_price_display_you_save_amount_class', $you_save_amount_class, $id);
$attributes = 'class="' . esc_attr($you_save_class) . '"';
// if ( ! $show_you_save )
// $attributes .= ' style="display:none;"';
//.........这里部分代码省略.........
开发者ID:Art2u,项目名称:pricing-deals-for-woocommerce,代码行数:101,代码来源:vtprd-parent-theme-functions.php
示例4: do_action
<?php
}
?>
</td>
<?php
}
?>
<td>
<?php
do_action('wpsc_product_before_description', wpsc_the_product_id(), $wp_query->post);
?>
</td>
<td class='wpsc_price_td'>
<?php
wpsc_the_product_price_display(array('output_you_save' => false));
?>
</td>
<td>
<?php
if (wpsc_product_external_link(wpsc_the_product_id()) != '') {
?>
<?php
$action = wpsc_product_external_link(wpsc_the_product_id());
?>
<?php
} else {
?>
<?php
$action = wpsc_this_page_url();
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:31,代码来源:wpsc-list_view.php
示例5: wpsc_specials
//.........这里部分代码省略.........
if (!$special_products->post_count) {
echo apply_filters('wpsc_specials_widget_no_items_message', __('We currently have no items on special.', 'wp-e-commerce'));
return;
}
$product_ids = array();
while ($special_products->have_posts()) {
$special_products->the_post();
?>
<h4><strong><a class="wpsc_product_title" href="<?php
echo esc_url(wpsc_product_url(wpsc_the_product_id(), false));
?>
"><?php
echo esc_html(wpsc_the_product_title());
?>
</a></h4></strong>
<?php
if ($show_description) {
?>
<div class="wpsc-special-description">
<?php
echo wpsc_the_product_description();
?>
</div>
<?php
}
// close show description
if (!in_array(wpsc_the_product_id(), $product_ids)) {
$product_ids[] = wpsc_the_product_id();
$has_children = wpsc_product_has_children(get_the_ID());
$width = get_option('product_image_width');
$height = get_option('product_image_height');
if ($show_thumbnails) {
if (wpsc_the_product_thumbnail()) {
?>
<a rel="<?php
echo str_replace(array(" ", '"', "'", '"', '''), array("_", "", "", "", ''), wpsc_the_product_title());
?>
" href="<?php
echo esc_url(wpsc_the_product_permalink());
?>
"><img class="product_image" id="product_image_<?php
echo esc_attr(wpsc_the_product_id());
?>
" alt="<?php
echo esc_attr(wpsc_the_product_title());
?>
" title="<?php
echo esc_attr(wpsc_the_product_title());
?>
" src="<?php
echo esc_url(wpsc_the_product_thumbnail($width, $height));
?>
"/></a>
<?php
} else {
?>
<a href="<?php
esc_url(wpsc_the_product_permalink());
?>
"><img class="no-image" id="product_image_<?php
echo esc_attr(wpsc_the_product_id());
?>
" alt="<?php
echo esc_attr(wpsc_the_product_title());
?>
" title="<?php
echo esc_attr(wpsc_the_product_title());
?>
" src="<?php
echo esc_url(WPSC_CORE_THEME_PATH . '/wpsc-images/noimage.png');
?>
" width="<?php
echo esc_attr($width);
?>
" height="<?php
echo esc_attr($height);
?>
" /></a>
<?php
}
?>
<br />
<?php
}
// close show thumbnails
?>
<div id="special_product_price_<?php
echo esc_attr(wpsc_the_product_id());
?>
">
<?php
wpsc_the_product_price_display(array('output_old_price' => $show_old_price, 'output_you_save' => $show_discount));
?>
</div><br />
<?php
}
}
wp_reset_postdata();
}
开发者ID:ashik968,项目名称:digiplot,代码行数:101,代码来源:specials_widget.php
注:本文中的wpsc_the_product_price_display函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论