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

PHP wpsc_the_product_price函数代码示例

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

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



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

示例1: get_related_products

/**
 * Related Products
 */
function get_related_products($product_id, $cats_search = true, $width, $height, $number = 20)
{
    global $wpdb;
    // Related products are found from category and tag
    $tags_array = array(0);
    $cats_array = array(0);
    $tags = '';
    $cats = '';
    // Get tags
    $terms = wp_get_post_terms($product_id, 'product_tag');
    foreach ($terms as $term) {
        $tags_array[] = $term->term_id;
    }
    $tags = implode(',', $tags_array);
    $terms = wp_get_post_terms($product_id, 'wpsc_product_category');
    foreach ($terms as $term) {
        $cats_array[] = $term->term_id;
    }
    $cats = implode(',', $cats_array);
    if ($cats_search) {
        $cats_search = "\n\t\t\t\t(\n\t\t\t\t\ttt.taxonomy ='wpsc_product_category'\n\t\t\t\t\tAND tt.term_taxonomy_id = tr.term_taxonomy_id\n\t\t\t\t\tAND tr.object_id  = p.ID\n\t\t\t\t\tAND tt.term_id IN ({$cats})\n\t\t\t\t)\n\t\t\t\tOR \n        ";
    } else {
        $cats_search = '';
    }
    $q = "\n\t\tSELECT p.ID\n\t\tFROM {$wpdb->term_taxonomy} AS tt, {$wpdb->term_relationships} AS tr, {$wpdb->posts} AS p\n\t\tWHERE \n\t\t\tp.ID != {$product_id}\n\t\t\tAND p.post_status = 'publish'\n\t\t\tAND p.post_type = 'wpsc-product'\n\t\t\tAND\n\t\t\t(\n                {$cats_search}\n\t\t\t\t(\n\t\t\t\t\ttt.taxonomy ='product_tag'\n\t\t\t\t\tAND tt.term_taxonomy_id = tr.term_taxonomy_id\n\t\t\t\t\tAND tr.object_id  = p.ID\n\t\t\t\t\tAND tt.term_id IN ({$tags})\n\t\t\t\t)\n\t\t\t)\n\t\tGROUP BY tr.object_id\n\t\tORDER BY RAND()\n\t\tLIMIT {$number};";
    $related = $wpdb->get_col($q);
    if (sizeof($related) > 0) {
        $args = array('post__in' => $related, 'post__not_in' => array($product_id), 'post_type' => 'wpsc-product', 'ignore_sticky_posts' => 1, 'posts_per_page' => $number, 'orderby' => 'rand');
        $related_query = new WP_Query($args);
        if ($related_query->have_posts()) {
            $_i = 0;
            while ($related_query->have_posts()) {
                $related_query->the_post();
                $_i++;
                $id = get_the_ID();
                $variants_exist = $wpdb->get_row("SELECT * FROM {$wpdb->posts} WHERE `post_parent`={$id} AND `post_type`='wpsc-product'", 'ARRAY_A');
                $related_array[$_i]['id'] = get_the_ID();
                $related_array[$_i]['title'] = esc_attr(get_the_title());
                $related_array[$_i]['image'] = etheme_get_image(0, $width, $height, false, $id);
                $related_array[$_i]['permalink'] = get_permalink();
                if ($variants_exist) {
                    if (wpsc_product_on_special($id)) {
                        $related_array[$_i]['normal_price'] = wpsc_product_normal_price($id);
                        $related_array[$_i]['price'] = wpsc_the_product_price($id);
                    } else {
                        $related_array[$_i]['normal_price'] = 0;
                        $related_array[$_i]['price'] = wpsc_the_product_price($id);
                    }
                } else {
                    $related_array[$_i]['normal_price'] = the_product_price($id);
                    $related_array[$_i]['price'] = the_product_price($id, true);
                }
                unset($variants_exist);
            }
        }
        wp_reset_postdata();
    }
    return $related_array;
}
开发者ID:Nguyenkain,项目名称:hanghieusales,代码行数:62,代码来源:products.php


示例2: viewed_product

 /**
  * Adds product properties to analytics.track() when product is viewed.
  *
  * @since  1.0.0
  * @access public
  *
  * @uses  func_get_args() Because our abstract class doesn't know how many parameters are passed to each hook
  *                        for each different platform, we use func_get_args().
  *
  * @return array Filtered array of name and properties for analytics.track().
  */
 public function viewed_product()
 {
     $args = func_get_args();
     $track = $args[0];
     if (is_singular('wpsc-product')) {
         $track = array('event' => __('Viewed Product', 'segment'), 'properties' => array('id' => get_the_ID(), 'sku' => wpsc_product_sku(), 'name' => wpsc_the_product_title(), 'price' => wpsc_string_to_float(wpsc_the_product_price()), 'category' => implode(', ', wp_list_pluck(wpsc_get_product_terms(get_the_ID(), 'wpsc_product_category'), 'name'))));
     }
     return $track;
 }
开发者ID:qfrery,项目名称:analytics-wordpress,代码行数:20,代码来源:wp-e-commerce.php


示例3: wpsc_the_product_permalink

					<td width="55%">
						<a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
							<strong><?php echo wpsc_the_product_title(); ?></strong>
						</a>
					</td>
					
					<td width="10" style="text-align: center;">
						<?php if(wpsc_product_has_stock()) : ?>
							<img src="<?php echo WPSC_URL; ?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
						<?php else: ?> 
							<img src="<?php echo WPSC_URL; ?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
						<?php endif; ?> 
					</td>
					
					<td width="10%">
						<span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span>
					</td>
					
					<td width="20%">
						<?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(); ?>						
						<?php endif; ?>
						<form class='product_form'  enctype="multipart/form-data" action="<?php echo $action; ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

							<?php /** the variation group HTML and loop */?>
							<div class="wpsc_variation_forms">
								<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
									<p>
										<label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:list_view.php


示例4: wpsc_the_product_price_display

function wpsc_the_product_price_display($args = array())
{
    if (empty($args['id'])) {
        $id = get_the_ID();
    } else {
        $id = (int) $args['id'];
    }
    $defaults = array('id' => $id, 'old_price_text' => __('Old Price: %s', 'wp-e-commerce'), 'price_text' => __('Price: %s', 'wp-e-commerce'), 'you_save_text' => __('You save: %s', 'wp-e-commerce'), '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);
    /**
     * wpsc_the_product_price_display_args filter args for product price display
     *
     * Paramters used to format price display can be set globally using this filter
     *
     * @since 4.0
     *
     * @type array $args array of parameters used to format product price
     * @type int $product_id WPeC Product ID for the current product
     */
    $r = apply_filters('wpsc_the_product_price_display_args', $r, $id);
    extract($r);
    // 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(array('type' => 'amount', 'product_id' => $id));
    $show_old_price = $show_you_save = wpsc_product_on_special($id);
    // Don't output old price HTML if not on sale.
    if (!wpsc_product_on_special($id)) {
        $output_old_price = $output_you_save = false;
    }
    // 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;"';
    }
    $you_save_before = sprintf($you_save_before, $attributes);
    $you_save_amount_before = sprintf($you_save_amount_before, esc_attr($you_save_amount_class), esc_attr($you_save_amount_id));
    $you_save = wpsc_currency_display($you_save);
    $old_price = $old_price_amount_before . $old_price . $old_price_amount_after;
    $current_price = $price_amount_before . $current_price . $price_amount_after;
    $you_save = $you_save_amount_before . $you_save . $you_save_amount_after;
    $old_price_text = sprintf($old_price_text, $old_price);
    $price_text = sprintf($price_text, $current_price);
    $you_save_text = sprintf($you_save_text, $you_save);
    if ($output_old_price) {
        echo $old_price_before . $old_price_text . $old_price_after . "\n";
    }
    if ($output_price) {
        echo $price_before . $price_text . $price_after . "\n";
    }
    if ($output_you_save) {
        echo $you_save_before . $you_save_text . $you_save_after . "\n";
    }
}
开发者ID:AngryBird3,项目名称:WP-e-Commerce,代码行数:84,代码来源:template-tags.php


示例5: if

						<input type="hidden" name="wpsc_update_quantity" value="true"/>
						</fieldset>
					<?php endif ;?>
					
						<div class="wpsc_product_price">
							<?php if(wpsc_product_is_donation()) : ?>
								<label for='donation_price_<?php echo wpsc_the_product_id(); ?>'><?php echo __('Donation', 'wpsc'); ?>:</label>
								<input type='text' id='donation_price_<?php echo wpsc_the_product_id(); ?>' name='donation_price' value='<?php echo $wpsc_query->product['price']; ?>' size='6' />
								<br />
							
							
							<?php else : ?>
								<?php if(wpsc_product_on_special()) : ?>
									<span class='oldprice'><?php echo __('Price', 'wpsc'); ?>: <?php echo wpsc_product_normal_price(); ?></span><br />
								<?php endif; ?>
								<span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span><?php echo __('Price', 'wpsc'); ?>:  <br/>
								<!-- multi currency code -->
								<?php if(wpsc_product_has_multicurrency()) : ?>
								<?php echo wpsc_display_product_multicurrency(); ?>
								<?php endif; ?>
								<!-- end multi currency code -->
								<?php if(get_option('display_pnp') == 1) : ?>
									<span class="pricedisplay"><?php echo wpsc_product_postage_and_packaging(); ?></span><?php echo __('P&amp;P', 'wpsc'); ?>:  <br />
								<?php endif; ?>							
							<?php endif; ?>
						</div>
					<?php if(function_exists('wpsc_akst_share_link') && (get_option('wpsc_share_this') == 1)) {
						echo wpsc_akst_share_link('return');
					} ?>
						
					<input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:single_product.php


示例6: wpsc_product_normal_price

/**
 * wpsc normal product price function
 * TODO determine why this function is here
 * @return string - returns some form of product price
 */
function wpsc_product_normal_price()
{
    return wpsc_the_product_price(false, true);
}
开发者ID:arturo-mayorga,项目名称:am_com,代码行数:9,代码来源:product-template.php


示例7: if

						</a>
					</div>
				<?php endif; ?> 
				
					
				<?php if(get_option('show_images_only') != 1): ?>
					<div class="grid_product_info">
						<div class="product_text">
							<strong><?php echo wpsc_the_product_title(); ?></strong>
							
						<?php if((wpsc_the_product_description() != '') && (get_option('display_description') == 1)): ?>
							<p class='griddescription'><?php echo wpsc_the_product_description(); ?></p>
						<?php endif; ?>
							
							<br/>
							<span class="pricedisplay"><?php echo wpsc_the_product_price(); ?></span>Price: 
							
						<?php if(get_option('display_moredetails') == 1) : ?>
							<br />
							<a href='<?php echo wpsc_the_product_permalink(); ?>'>More Details</a>
						<?php endif; ?> 
						</div>
					</div>
					<div class="grid_more_info">
						<form class='product_form'  enctype="multipart/form-data" action="<?php echo wpsc_this_page_url(); ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>" id="product_<?php echo wpsc_the_product_id(); ?>" >
							<input type="hidden" value="add_to_cart" name="wpsc_ajax_action"/>
							<input type="hidden" value="<?php echo wpsc_the_product_id(); ?>" name="product_id"/>
							
							
							<?php if(get_option('display_variations') == 1) : ?>
								<?php /** the variation group HTML and loop */ ?>
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:grid_view.php


示例8: 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


示例9: wpsc_the_product_permalink

					<td width="55%">
						<a class="wpsc_product_title" href="<?php echo wpsc_the_product_permalink(); ?>">
							<strong><?php echo wpsc_the_product_title(); ?></strong>
						</a>
					</td>
					
					<td width="10" style="text-align: center;">
						<?php if(wpsc_product_has_stock()) : ?>
							<img src="<?php echo WPSC_URL; ?>/images/yes_stock.gif" alt="Yes" title="Yes" style="margin-top: 4px;"/>
						<?php else: ?> 
							<img src="<?php echo WPSC_URL; ?>/images/no_stock.gif" title='No' alt='No' style="margin-top: 4px;"/>
						<?php endif; ?> 
					</td>
					
					<td width="10%">
						<span id="product_price_<?php echo wpsc_the_product_id(); ?>" class="pricedisplay"><?php echo wpsc_the_product_price(get_option('wpsc_hide_decimals')); ?></span>
					</td>
					
					<td width="20%">
						<?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(); ?>						
						<?php endif; ?>
						<form id="product_<?php echo wpsc_the_product_id(); ?>" class='product_form'  enctype="multipart/form-data" action="<?php echo $action; ?>" method="post" name="product_<?php echo wpsc_the_product_id(); ?>">

							<?php /** the variation group HTML and loop */?>
							<div class="wpsc_variation_forms">
								<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
									<p>
										<label for="<?php echo wpsc_vargrp_form_id(); ?>"><?php echo wpsc_the_vargrp_name(); ?>:</label>
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:list_view.php


示例10: elseif

     }
     $html_content .= '</div>';
 } elseif ($item_key == 'WPeC_old_price') {
     $html_content .= '<div class="element element_' . $item_id . ' ' . $item_key . '"  >';
     $is_product = get_post_type(get_the_ID());
     $active_plugins = get_option('active_plugins');
     if (in_array('wp-e-commerce/wp-shopping-cart.php', (array) $active_plugins) && $is_product == 'wpsc-product') {
         $html_content .= wpsc_product_normal_price();
     }
     $html_content .= '</div>';
 } elseif ($item_key == 'WPeC_sale_price') {
     $html_content .= '<div class="element element_' . $item_id . ' ' . $item_key . '"  >';
     $is_product = get_post_type(get_the_ID());
     $active_plugins = get_option('active_plugins');
     if (in_array('wp-e-commerce/wp-shopping-cart.php', (array) $active_plugins) && $is_product == 'wpsc-product') {
         $html_content .= wpsc_the_product_price();
     }
     $html_content .= '</div>';
 } elseif ($item_key == 'WPeC_rating_star') {
     $html_content .= '<div class="element element_' . $item_id . ' ' . $item_key . '"  >';
     $is_product = get_post_type(get_the_ID());
     $active_plugins = get_option('active_plugins');
     if (in_array('wp-e-commerce/wp-shopping-cart.php', (array) $active_plugins) && $is_product == 'wpsc-product') {
         $html_content .= wpsc_product_rater();
     }
     $html_content .= '</div>';
 } elseif ($item_key == 'WPeC_categories') {
     $html_content .= '<div class="element element_' . $item_id . ' ' . $item_key . '"  >';
     $is_product = get_post_type(get_the_ID());
     $active_plugins = get_option('active_plugins');
     if (in_array('wp-e-commerce/wp-shopping-cart.php', (array) $active_plugins) && $is_product == 'wpsc-product') {
开发者ID:brettratner,项目名称:TCNJ-IMM-Showcase-2016,代码行数:31,代码来源:layer-content.php


示例11: get_post_thumbnail_id

         global $product, $woocommerce;
         $thumbnail_id = get_post_thumbnail_id($post->ID);
         $size = "large";
         $image_src = wp_get_attachment_image_src($thumbnail_id, $size, false);
         // Get attached image URL
         $NV_previewimgurl = $image_src[0];
         if (empty($NV_previewimgurl)) {
             $NV_previewimgurl = $woocommerce->plugin_url() . '/assets/images/placeholder.png';
         }
         $NV_productprice = $product->get_price_html();
         // Product Price
     }
     if (class_exists('WPSC_Query')) {
         $NV_previewimgurl = wpsc_the_product_image();
         // Product Image
         $NV_productprice = wpsc_the_product_price();
         // Product Price
     }
     $NV_previewimgurl = parse_url($NV_previewimgurl, PHP_URL_PATH);
     // make relative Image URL
 } else {
     $NV_previewimgurl = get_post_meta($post->ID, '_cmb_previewimgurl', true);
     // Preview Image URL
 }
 $image = catch_image();
 // Check for images within post
 // check what image to use, custom, featured, image within post.
 if (empty($NV_previewimgurl)) {
     $post_image_id = get_post_thumbnail_id($post->ID);
     if (!empty($post_image_id)) {
         $thumbnail = wp_get_attachment_image_src($post_image_id, false);
开发者ID:ConceptHaus,项目名称:backup,代码行数:31,代码来源:post-categories-class.php


示例12: getSliderProducts


//.........这里部分代码省略.........
</a>
				<?php 
            }
            ?>
 				
			</h2>
			<!-- <div class="wpsc_product_price">
			<?php 
            if (wpsc_product_is_donation()) {
                ?>
				<label for='donation_price_<?php 
                echo wpsc_the_product_id();
                ?>
'><?php 
                echo __('Donation', 'flexishop');
                ?>
:</label>
				<input type='text' id='donation_price_<?php 
                echo wpsc_the_product_id();
                ?>
' name='donation_price' value='<?php 
                echo $wpsc_query->product['price'];
                ?>
' size='6' />
				<br />
			
			
			<?php 
            } else {
                ?>
				<?php 
                if (wpsc_product_on_special()) {
                    ?>
					<span class='oldprice'><?php 
                    echo __('Price', 'flexishop');
                    ?>
: <?php 
                    echo wpsc_product_normal_price(get_option('wpsc_hide_decimals'));
                    ?>
</span><br />
				<?php 
                }
                ?>
				<span id="product_price_<?php 
                echo wpsc_the_product_id();
                ?>
" class="pricedisplay <?php 
                if (wpsc_product_on_special()) {
                    echo "sale-price";
                }
                ?>
"><?php 
                if (wpsc_product_on_special()) {
                    echo __("Sale Price: ", 'flexishop');
                }
                echo wpsc_the_product_price(get_option('wpsc_hide_decimals'));
                ?>
</span>					
			<?php 
            }
            ?>
			</div> -->
			<?php 
            if (wpsc_the_product_additional_description()) {
                ?>
			<div class="description">
			<?php 
                $value = '';
                $the_addl_desc = wpsc_the_product_additional_description();
                if (is_serialized($the_addl_desc)) {
                    $addl_descriptions = @unserialize($the_addl_desc);
                } else {
                    $addl_descriptions = array('addl_desc', $the_addl_desc);
                }
                if (isset($addl_descriptions['addl_desc'])) {
                    $value = $addl_descriptions['addl_desc'];
                }
                if (function_exists('wpsc_addl_desc_show')) {
                    echo wpsc_addl_desc_show($addl_descriptions);
                } else {
                    echo stripslashes(wpautop($the_addl_desc, $br = 1));
                }
                ?>
			</div>
			<?php 
            }
            ?>
			<a href="<?php 
            echo wpsc_the_product_permalink();
            ?>
" class="buy-now"><?php 
            _e('Buy Now', 'flexishop');
            ?>
</a>
			</div>
		</li>
		<?php 
        }
    }
}
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:101,代码来源:functions.php


示例13: wpsc_specials


//.........这里部分代码省略.........
        while (wpsc_have_products()) {
            wpsc_the_product();
            if (!in_array(wpsc_the_product_id(), $product_ids)) {
                $product_ids[] = wpsc_the_product_id();
                if ($show_thumbnails) {
                    if (wpsc_the_product_thumbnail()) {
                        ?>
						<a rel="<?php 
                        echo str_replace(array(" ", '"', "'", '&quot;', '&#039;'), array("_", "", "", "", ''), wpsc_the_product_title());
                        ?>
" href="<?php 
                        echo wpsc_the_product_permalink();
                        ?>
">
							<img class="product_image" id="product_image_<?php 
                        echo wpsc_the_product_id();
                        ?>
" alt="<?php 
                        echo wpsc_the_product_title();
                        ?>
" title="<?php 
                        echo wpsc_the_product_title();
                        ?>
" src="<?php 
                        echo wpsc_the_product_thumbnail();
                        ?>
"/>
						</a>
				<?php 
                    } else {
                        ?>
							<a href="<?php 
                        echo wpsc_the_product_permalink();
                        ?>
">
							<img class="no-image" id="product_image_<?php 
                        echo wpsc_the_product_id();
                        ?>
" alt="No Image" title="<?php 
                        echo wpsc_the_product_title();
                        ?>
" src="<?php 
                        echo WPSC_URL;
                        ?>
/wpsc-theme/wpsc-images/noimage.png" width="<?php 
                        esc_attr_e(get_option('product_image_width'));
                        ?>
" height="<?php 
                        esc_attr_e(get_option('product_image_height'));
                        ?>
" />
							</a>
				<?php 
                    }
                    ?>
				<?php 
                }
                // close show thumbnails
                ?>
 
				<br />
				<span id="special_product_price_<?php 
                echo wpsc_the_product_id();
                ?>
">
				<!-- price display -->
				<?php 
                echo wpsc_the_product_price();
                ?>
				</span><br />			
				<strong><a class="wpsc_product_title" href="<?php 
                echo wpsc_product_url(wpsc_the_product_id(), false);
                ?>
"><?php 
                echo wpsc_the_product_title();
                ?>
</a></strong><br /> 
				
				<?php 
                if ($show_description) {
                    ?>
					<div class="wpsc-special-description">
						<?php 
                    echo wpsc_the_product_description();
                    ?>
					</div>									
				<?php 
                }
                // close show description
                ?>
 
			
				<?php 
            }
        }
        list($wp_query, $special_products) = array($special_products, $wp_query);
        // swap the wpsc_query object
        wp_reset_query();
    }
}
开发者ID:arturo-mayorga,项目名称:am_com,代码行数:101,代码来源:specials_widget.php


示例14: post_object

 function post_object($id, $term_id = false, $matches = false)
 {
     $unset_array = array('post_date_gmt', 'post_status', 'comment_status', 'ping_status', 'post_password', 'post_content_filtered', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'guid', 'menu_order', 'post_mime_type', 'comment_count', 'ancestors', 'filter');
     global $post;
     $date_format = get_option('date_format');
     $post = get_post($id);
     if ($term_id) {
         if (!in_category($term_id, $post->ID)) {
             return false;
         }
     }
     $size = array('height' => 50, 'width' => 50);
     if ($post != null) {
         $post_object = new stdclass();
         $post_link = get_permalink($post->ID);
         if (in_array('{post_image}', $matches) || in_array('{post_image_html}', $matches)) {
             $post_thumbnail_id = get_post_thumbnail_id($post->ID);
             if ($post_thumbnail_id > 0) {
                 $thumb = wp_get_attachment_image_src($post_thumbnail_id, array($size['height'], $size['width']));
                 $post_object->post_image = trim($thumb[0]) == "" ? WEBNUS_SEARCH_NO_IMAGE : $thumb[0];
                 if (in_array('{post_image_html}', $matches)) {
                     $post_object->post_image_html = '<img src="' . $post_object->post_image . '" width="' . $size['width'] . '" height="' . $size['height'] . '"/>';
                 }
             } else {
                 if ($src = $this->get_image_from_content($post->post_content, $size['height'], $size['width'])) {
                     $post_object->post_image = $src['src'] ? $src['src'] : WEBNUS_SEARCH_NO_IMAGE;
                     if (in_array('{post_image_html}', $matches)) {
                         $post_object->post_image_html = '<img src="' . $post_object->post_image . '" width="' . $src['width'] . '" height="' . $src['height'] . '" />';
                     }
                 } else {
                     $post_object->post_image = WEBNUS_SEARCH_NO_IMAGE;
                     if (in_array('{post_image_html}', $matches)) {
                         $post_object->post_image_html = '';
                     }
                 }
             }
         }
         if ($post->post_type == "wpsc-product") {
             if (function_exists('wpsc_calculate_price')) {
                 if (in_array('{wpsc_price}', $matches)) {
                     $post_object->wpsc_price = wpsc_the_product_price();
                 }
                 if (in_array('{wpsc_shipping}', $matches)) {
                     $post_object->wpsc_shipping = strip_tags(wpsc_product_postage_and_packaging());
                 }
                 if (in_array('{wpsc_image}', $matches)) {
                     $post_object->wpsc_image = wpsc_the_product_image($size['height'], $size['width']);
                 }
             }
         }
         if ($post->post_type == 'product' && class_exists('WC_Product_Factory')) {
             $product_factory = new WC_Product_Factory();
             global $product;
             $product = $product_factory->get_product($post);
             if ($product->is_visible()) {
                 foreach ($matches as $match) {
                     $match = str_replace(array('{', '}'), '', $match);
                     if (in_array($match, array('categories', 'tags'))) {
                         $method = "get_" . $match;
                         if (method_exists($product, $method)) {
                             $term_list = call_user_func(array($product, $method), '');
                             if ($term_list) {
                                 $post_object->{$match} = '<span class="sf_list sf_' . $match . '">' . $term_list . '</span>';
                             } else {
                                 $post_object->{$match} = "";
                             }
                         }
                     } elseif ($match == 'add_to_cart_button') {
                         ob_start();
                         do_action('woocommerce_' . $product->product_type . '_add_to_cart');
                         $post_object->{$match} = '<div class="product">' . ob_get_contents() . '</div>';
                         ob_end_clean();
                     } else {
                         $method = "get_" . $match;
                         if (method_exists($product, $method)) {
                             $post_object->{$match} = call_user_func(array($product, $method));
                         } elseif (method_exists($product, $match)) {
                             $post_object->{$match} = call_user_func(array($product, $match));
                         }
                     }
                 }
             }
             /*
             $post->sku = $product->get_sku();
             $post->sale_price = $product->get_sale_price();
             $post->regular_price = $product->get_regular_price();
             $post->price = $product->get_price();
             $post->price_including_tax = $product->get_price_including_tax();
             $post->price_excluding_tax = $product->get_price_excluding_tax();
             $post->price_suffix = $product->get_price_suffix();
             $post->price_html = $product->get_price_html();
             $post->price_html_from_text = $product->get_price_html_from_text();
             $post->average_rating = $product->get_average_rating();
             $post->rating_count = $product->get_rating_count();
             $post->rating_html = $product->get_rating_html();
             $post->dimensions = $product->get_dimensions();
             $post->shipping_class = $product->get_shipping_class();
             $post->add_to_cart_text = $product->add_to_cart_text();
             $post->single_add_to_cart_text = $product->single_add_to_cart_text();
             $post->add_to_cart_url = $product->add_to_cart_url();
//.........这里部分代码省略.........
开发者ID:kulgee001,项目名称:VoiceOfADF,代码行数:101,代码来源:live-search.php


示例15: __

                ?>
										<span class='oldprice'><?php 
                echo __('Price', 'wpsc');
                ?>
: <?php 
                echo wpsc_product_normal_price(get_option('wpsc_hide_decimals'));
                ?>
</span><br />
									<?php 
            }
            ?>
									<span id="product_price_<?php 
            echo wpsc_the_product_id();
            ?>
" class="pricedisplay"><?php 
            echo wpsc_the_product_price(get_option('wpsc_hide_decimals'));
            ?>
</span><?php 
            echo __('Price', 'wpsc');
            ?>
:  <br/>
									<?php 
            if (get_option('display_pnp') == 1) {
                ?>
										<span class="pricedisplay"><?php 
                echo wpsc_product_postage_and_packaging(get_option('wpsc_hide_decimals'));
                ?>
</span><?php 
                echo __('P&amp;P', 'wpsc');
                ?>
:  <br />
开发者ID:Jonathonbyrd,项目名称:wp-ecommerce,代码行数:31,

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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