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

PHP wpsc_product_is_donation函数代码示例

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

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



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

示例1: the_permalink

              <img src="<?php 
                echo $product_thumb;
                ?>
">
            </a>
            <a href="<?php 
                the_permalink();
                ?>
">
              <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();
开发者ID:samtripp,项目名称:emporium-theme,代码行数:31,代码来源:page-products.php


示例2: wpsc_also_bought

/**
 * Displays products that were bought along with the product defined by $product_id.
 * This functionality will be deprecated and be provided by a plugin in a future version.
 */
function wpsc_also_bought($product_id)
{
    global $wpdb;
    if (get_option('wpsc_also_bought') == 0) {
        return '';
    }
    // To be made customiseable in a future release
    $also_bought_limit = 3;
    $element_widths = 96;
    $image_display_height = 96;
    $image_display_width = 96;
    // Filter will be used by a plugin to provide 'Also Bought' functionality when this is deprecated from core.
    // Filter is currently private and should not be used by plugin/theme devs as it may only be temporary.
    $output = apply_filters('_wpsc_also_bought', '', $product_id);
    if (!empty($output)) {
        return $output;
    }
    // If above filter returns output then the following is ignore and can be deprecated in future.
    $also_bought = $wpdb->get_results($wpdb->prepare("SELECT `" . $wpdb->posts . "`.* FROM `" . WPSC_TABLE_ALSO_BOUGHT . "`, `" . $wpdb->posts . "` WHERE `selected_product`= %d AND `" . WPSC_TABLE_ALSO_BOUGHT . "`.`associated_product` = `" . $wpdb->posts . "`.`id` AND `" . $wpdb->posts . "`.`post_status` IN('publish','protected') ORDER BY `" . WPSC_TABLE_ALSO_BOUGHT . "`.`quantity` DESC LIMIT {$also_bought_limit}", $product_id), ARRAY_A);
    if (is_array($also_bought) && count($also_bought) > 0) {
        $output .= '<h2 class="prodtitles wpsc_also_bought">' . __('People who bought this item also bought', 'wpsc') . '</h2>';
        $output .= '<div class="wpsc_also_bought">';
        foreach ($also_bought as $also_bought_data) {
            $output .= '<div class="wpsc_also_bought_item" style="width: ' . $element_widths . 'px;">';
            if (get_option('show_thumbnails') == 1) {
                $image_path = wpsc_the_product_thumbnail($image_display_width, $image_display_height, $also_bought_data['ID']);
                if ($image_path) {
                    $output .= '<a href="' . esc_attr(get_permalink($also_bought_data['ID'])) . '" class="preview_link" rel="' . esc_attr(sanitize_html_class(get_the_title($also_bought_data['ID']))) . '">';
                    $output .= '<img src="' . esc_attr($image_path) . '" id="product_image_' . $also_bought_data['ID'] . '" class="product_image" />';
                    $output .= '</a>';
                } else {
                    if (get_option('product_image_width') != '') {
                        $width_and_height = 'width="' . $image_display_height . '" height="' . $image_display_height . '" ';
                    } else {
                        $width_and_height = '';
                    }
                    $output .= '<img src="' . WPSC_CORE_THEME_URL . '/wpsc-images/noimage.png" title="' . esc_attr(get_the_title($also_bought_data['ID'])) . '" alt="' . esc_attr(get_the_title($also_bought_data['ID'])) . '" id="product_image_' . $also_bought_data['ID'] . '" class="product_image" ' . $width_and_height . '/>';
                }
            }
            $output .= '<a class="wpsc_product_name" href="' . get_permalink($also_bought_data['ID']) . '">' . get_the_title($also_bought_data['ID']) . '</a>';
            if (!wpsc_product_is_donation($also_bought_data['ID'])) {
                // Ideally use the wpsc_the_product_price_display() function here but needs some tweaking
                $price = get_product_meta($also_bought_data['ID'], 'price', true);
                $special_price = get_product_meta($also_bought_data['ID'], 'special_price', true);
                if (!empty($special_price)) {
                    $output .= '<span style="text-decoration: line-through;">' . wpsc_currency_display($price) . '</span>';
                    $output .= wpsc_currency_display($special_price);
                } else {
                    $output .= wpsc_currency_display($price);
                }
            }
            $output .= '</div>';
        }
        $output .= '</div>';
        $output .= '<br clear="all" />';
    }
    return $output;
}
开发者ID:osuarcher,项目名称:WP-e-Commerce,代码行数:62,代码来源:product.php


示例3: if

					<?php /** the variation group HTML and loop ends here */?>
									
					
					<!-- THIS IS THE QUANTITY OPTION MUST BE ENABLED FROM ADMIN SETTINGS -->
					<?php if(wpsc_has_multi_adding()): ?>
						<fieldset>
						<label class='wpsc_quantity_update' for='wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]'><?php echo __('Quantity', 'wpsc'); ?>:</label>
						
						<input type="text" id='wpsc_quantity_update' name="wpsc_quantity_update[<?php echo wpsc_the_product_id(); ?>]" size="2" value="1"/>
						<input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/>
						<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 -->
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:single_product.php


示例4: getSliderProducts

function getSliderProducts($products)
{
    $products = explode(",", $products);
    global $wpsc_query, $wpdb;
    foreach ($products as $product) {
        $image_width = get_option('single_view_image_width');
        $image_height = get_option('single_view_image_height');
        $options = get_option('site_basic_options');
        $wpsc_query = new WPSC_Query(array('product_id' => $product));
        while (wpsc_have_products()) {
            wpsc_the_product();
            ?>
			<li class="feature-product">
			<?php 
            if (wpsc_the_product_thumbnail()) {
                ?>
			<div class="product-image">
				<a rel="<?php 
                echo str_replace(array(" ", '"', "'", '&quot;', '&#039;'), array("_", "", "", "", ''), wpsc_the_product_title());
                ?>
" class="thickbox preview_link" href="<?php 
                echo wpsc_the_product_image();
                ?>
">
					<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 
                if ($options['themelayout'] == 'boxed') {
                    bloginfo('template_url');
                    ?>
/timthumb.php?src=<?php 
                    echo wpsc_the_product_image($image_width, $image_height);
                    ?>
&w=457<?php 
                } else {
                    echo wpsc_the_product_image($image_width, $image_height);
                }
                ?>
" />
				</a>
			</div>
			<?php 
            } else {
                ?>
				<div class="product-image product-thumb item_no_image">
					<a href="<?php 
                echo wpsc_the_product_permalink();
                ?>
">
					<span><?php 
                _e('No Image Available', 'flexishop');
                ?>
</span>
					</a>
				</div>
			<?php 
            }
            ?>
			<div class="product-content">
			<h2 class="prodtitles">
				<?php 
            if (get_option('hide_name_link') == 1) {
                ?>
					<span><?php 
                echo wpsc_the_product_title();
                ?>
</span>
				<?php 
            } else {
                ?>
 
					<a class="wpsc_product_title" href="<?php 
                echo wpsc_the_product_permalink();
                ?>
"><?php 
                echo wpsc_the_product_title();
                ?>
</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');
                ?>
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:101,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wpsc_product_normal_price函数代码示例发布时间:2022-05-23
下一篇:
PHP wpsc_product_has_variations函数代码示例发布时间: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