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

PHP woocommerce_placeholder_img_src函数代码示例

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

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



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

示例1: woocommerce_get_product_thumbnail

 function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
 {
     global $post, $woocommerce, $data;
     if (!$placeholder_width) {
         if (function_exists('wc_get_image_size')) {
             $placeholder_width = wc_get_image_size('shop_catalog_image_width');
         } else {
             $placeholder_width = $woocommerce->get_image_size('shop_catalog_image_width');
         }
     }
     if (!$placeholder_height) {
         if (function_exists('wc_get_image_size')) {
             $placeholder_height = wc_get_image_size('shop_catalog_image_height');
         } else {
             $placeholder_height = $woocommerce->get_image_size('shop_catalog_image_height');
         }
     }
     $output = '<div class="image">';
     if (has_post_thumbnail()) {
         $width = '150';
         $height = '130';
         if (!empty($data['woo_cat_image_size'])) {
             $width = $data['woo_cat_image_size']['width'];
             $height = $data['woo_cat_image_size']['height'];
         }
         $image = vt_resize(get_post_thumbnail_id($post->ID), '', $width, $height, true);
         $output .= '<a href="' . get_permalink() . '"><img src="' . $image['url'] . '" alt=""></a>';
     } else {
         $output .= '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />';
     }
     $output .= '</div>';
     return $output;
 }
开发者ID:sumovska,项目名称:jodi,代码行数:33,代码来源:zn-woocommerce-init.php


示例2: wc_placeholder_img_src

 public static function wc_placeholder_img_src()
 {
     if (self::is_wc_version_gte_2_1()) {
         return wc_placeholder_img_src();
     } else {
         return woocommerce_placeholder_img_src();
     }
 }
开发者ID:AndyA,项目名称:River,代码行数:8,代码来源:class-wc-swatches-compatibility.php


示例3: widget

    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance)
    {
        global $woocommerce;
        // Use default title as fallback
        $title = '' === $instance['title'] ? __('Random Products', 'woocommerce') : $instance['title'];
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        // Setup product query
        $query_args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => $instance['number'], 'orderby' => 'rand', 'no_found_rows' => 1);
        $query_args['meta_query'] = array();
        if (!$instance['show_variations']) {
            $query_args['meta_query'][] = $woocommerce->query->visibility_meta_query();
            $query_args['post_parent'] = 0;
        }
        $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
        $query = new WP_Query($query_args);
        if ($query->have_posts()) {
            echo $args['before_widget'];
            if ('' !== $title) {
                echo $args['before_title'], $title, $args['after_title'];
            }
            ?>

			<ul class="product_list_widget">
				<?php 
            while ($query->have_posts()) {
                $query->the_post();
                global $product;
                ?>
					<li>
						<a href="<?php 
                the_permalink();
                ?>
">
							<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('shop_thumbnail');
                } else {
                    echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $woocommerce->get_image_size('shop_thumbnail_image_width') . '" height="' . $woocommerce->get_image_size('shop_thumbnail_image_height') . '" />';
                }
                ?>
							<?php 
                the_title();
                ?>
						</a>
						<?php 
                echo $product->get_price_html();
                ?>
					</li>
				<?php 
            }
            ?>
			</ul>

			<?php 
            echo $args['after_widget'];
        }
    }
开发者ID:vjdesign,项目名称:fontaine,代码行数:66,代码来源:widget-random_products.php


示例4: woops_get_product_thumbnail

 public static function woops_get_product_thumbnail($post_id, $size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0)
 {
     global $woocommerce;
     $woocommerce_db_version = get_option('woocommerce_db_version', null);
     $shop_catalog = version_compare($woocommerce_db_version, '2.1', '<') ? $woocommerce->get_image_size('shop_catalog') : wc_get_image_size('shop_catalog');
     if (is_array($shop_catalog) && isset($shop_catalog['width']) && $placeholder_width == 0) {
         $placeholder_width = $shop_catalog['width'];
     }
     if (is_array($shop_catalog) && isset($shop_catalog['height']) && $placeholder_height == 0) {
         $placeholder_height = $shop_catalog['height'];
     }
     if (has_post_thumbnail($post_id)) {
         return get_the_post_thumbnail($post_id, $size);
     }
     $mediumSRC = '';
     if (trim($mediumSRC == '')) {
         $args = array('post_parent' => $post_id, 'numberposts' => 1, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'ID', 'post_status' => null);
         $attachments = get_posts($args);
         if ($attachments) {
             foreach ($attachments as $attachment) {
                 $mediumSRC = wp_get_attachment_image($attachment->ID, $size, true);
                 break;
             }
         }
     }
     if (trim($mediumSRC == '')) {
         // Load the product
         $product = get_post($post_id);
         // Get ID of parent product if one exists
         if (!empty($product->post_parent)) {
             $post_id = $product->post_parent;
         }
         if (has_post_thumbnail($post_id)) {
             return get_the_post_thumbnail($post_id, $size);
         }
         if (trim($mediumSRC == '')) {
             $args = array('post_parent' => $post_id, 'numberposts' => 1, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'DESC', 'orderby' => 'ID', 'post_status' => null);
             $attachments = get_posts($args);
             if ($attachments) {
                 foreach ($attachments as $attachment) {
                     $mediumSRC = wp_get_attachment_image($attachment->ID, $size, true);
                     break;
                 }
             }
         }
     }
     if (trim($mediumSRC != '')) {
         return $mediumSRC;
     } else {
         return '<img src="' . (version_compare($woocommerce_db_version, '2.1', '<') ? woocommerce_placeholder_img_src() : wc_placeholder_img_src()) . '" alt="Placeholder" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />';
     }
 }
开发者ID:abesamislyndon,项目名称:femaccms,代码行数:52,代码来源:class-wc-predictive-search.php


示例5: jck_quickview_content

    function jck_quickview_content()
    {
        global $post, $product, $woocommerce;
        echo '<div class="hide">';
        echo '<div itemscope itemtype="http://schema.org/Product" id="product-' . get_the_ID() . '" class="jck_quickview product">';
        echo '<div class="images">';
        if (has_post_thumbnail()) {
            echo get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'));
        } else {
            echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" class="attachment-shop_single wp-post-image" />';
        }
        $attachment_ids = $product->get_gallery_attachment_ids();
        if ($attachment_ids) {
            ?>
						<div class="thumbnails"><?php 
            if (has_post_thumbnail()) {
                array_unshift($attachment_ids, get_post_thumbnail_id($post->ID));
            }
            $loop = 0;
            $columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
            foreach ($attachment_ids as $attachment_id) {
                $wrapClasses = array('quickviewThumbs-' . $columns . 'col', 'jck_quickview_thumb');
                $classes = array('attachment-shop_thumbnail');
                if ($loop == 0 || $loop % $columns == 0) {
                    $wrapClasses[] = 'first';
                }
                if ($loop == 0) {
                    $wrapClasses[] = 'firstThumb';
                }
                if (($loop + 1) % $columns == 0) {
                    $wrapClasses[] = 'last';
                }
                $image_class = esc_attr(implode(' ', $classes));
                $lrgImg = wp_get_attachment_image_src($attachment_id, 'shop_single');
                echo '<a href="' . $lrgImg[0] . '" class="' . esc_attr(implode(' ', $wrapClasses)) . '">' . wp_get_attachment_image($attachment_id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'), false, array('class' => $image_class)) . '</a>';
                $loop++;
            }
            ?>
</div>
						<?php 
        }
        echo '</div>';
        echo '<div class="summary entry-summary">';
        do_action('jck_quickview_single_product_summary');
        echo '</div><!-- .summary -->';
        echo '</div><!-- #product-' . get_the_ID() . ' -->';
        echo '</div>';
    }
开发者ID:iplaydu,项目名称:Bob-Ellis-Shoes,代码行数:48,代码来源:jck_woo_quickview.php


示例6: woocommerce_subcategory_thumbnail

function woocommerce_subcategory_thumbnail($category)
{
    // Figure
    $figure = \Drone\HTML::figure()->class('featured full-width');
    // Hyperlink
    $a = $figure->addNew('a')->attr(Everything::getImageAttrs('a', array('fancybox' => false)))->href(get_term_link($category->slug, 'product_cat'));
    // Thumbnail
    $thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
    $thumbnail_size = apply_filters('single_product_small_thumbnail_size', 'shop_catalog');
    if ($thumbnail_id) {
        $a->add(wp_get_attachment_image($thumbnail_id, $thumbnail_size));
    } elseif (woocommerce_placeholder_img_src()) {
        $a->add(woocommerce_placeholder_img($thumbnail_size));
    }
    echo $figure->html();
}
开发者ID:xpander54,项目名称:wp-drz,代码行数:16,代码来源:woocommerce.php


示例7: woocommerce_template_loop_product_thumbnail

 public function woocommerce_template_loop_product_thumbnail()
 {
     global $post, $product, $woocommerce;
     $placeholder_width = get_option('shop_catalog_image_size');
     $placeholder_width = $placeholder_width['width'];
     $placeholder_height = get_option('shop_catalog_image_size');
     $placeholder_height = $placeholder_height['height'];
     $output = '';
     $class = 'image-no-effect';
     if (has_post_thumbnail()) {
         $attachment_ids = $product->get_gallery_attachment_ids();
         if ($attachment_ids) {
             $class = 'image-effect';
             $output .= wp_get_attachment_image($attachment_ids[0], 'shop_catalog', false, array('class' => "attachment-shop_catalog image-hover"));
         }
         $output .= get_the_post_thumbnail($post->ID, 'shop_catalog', array('class' => $class));
     } else {
         $output .= '<img src="' . woocommerce_placeholder_img_src() . '" alt="' . __('Placeholder', 'gp_lang') . '" class="' . $class . '" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />';
     }
     echo $output;
 }
开发者ID:shubham79,项目名称:Jhintaak,代码行数:21,代码来源:woocommerce.php


示例8: get_template_image_file_info

 /**
  * get_template_image_file_info( $file )
  *
  * @access public
  * @since 3.8
  * @param $file string filename
  * @return PATH to the file
  */
 public static function get_template_image_file_info($file = '')
 {
     // If we're not looking for a file, do not proceed
     if (empty($file)) {
         return;
     }
     // Look for file in stylesheet
     $image_info = array();
     if (file_exists(get_stylesheet_directory() . '/images/' . $file)) {
         $file_url = get_stylesheet_directory_uri() . '/images/' . $file;
         list($current_width, $current_height) = getimagesize(get_stylesheet_directory() . '/images/' . $file);
         $image_info['url'] = $file_url;
         $image_info['width'] = $current_width;
         $image_info['height'] = $current_height;
         // Look for file in template
     } elseif (file_exists(get_template_directory() . '/images/' . $file)) {
         $file_url = get_template_directory_uri() . '/images/' . $file;
         list($current_width, $current_height) = getimagesize(get_template_directory() . '/images/' . $file);
         $image_info['url'] = $file_url;
         $image_info['width'] = $current_width;
         $image_info['height'] = $current_height;
         // Backwards compatibility
     } else {
         $woocommerce_db_version = get_option('woocommerce_db_version', null);
         $file_url = version_compare($woocommerce_db_version, '2.1', '<') ? woocommerce_placeholder_img_src() : wc_placeholder_img_src();
         list($current_width, $current_height) = getimagesize($file_url);
         $image_info['url'] = $file_url;
         $image_info['width'] = $current_width;
         $image_info['height'] = $current_height;
     }
     if (is_ssl()) {
         $file_url = str_replace('http://', 'https://', $file_url);
         $image_info['url'] = $file_url;
     }
     return $image_info;
 }
开发者ID:TheTypoMaster,项目名称:wp_marketplace,代码行数:44,代码来源:class-slider-functions.php


示例9: wp_get_attachment_image_src

    if ($presizeimage == 1) {
        $product_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
        $product_image_url = $product_image[0];
        $image_url = aq_resize($product_image_url, $productimgwidth, $productimgheight, true);
        if (empty($image_url)) {
            $image_url = $product_image_url;
        }
        $image = '<img width="' . $productimgwidth . '" height="' . $productimgheight . '" src="' . $image_url . '" class="attachment-shop_single wp-post-image" title="' . esc_attr(get_the_title(get_post_thumbnail_id())) . '">';
    } else {
        $image = get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'), array('title' => $image_title));
    }
    $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
    $image_link = wp_get_attachment_url(get_post_thumbnail_id());
    $attachment_count = count($product->get_gallery_attachment_ids());
    if ($attachment_count > 0) {
        $gallery = '[product-gallery]';
    } else {
        $gallery = '';
    }
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s"  rel="lightbox' . $gallery . '">%s</a>', $image_link, $image_title, $image), $post->ID);
} else {
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<img src="%s" alt="Placeholder" />', woocommerce_placeholder_img_src()), $post->ID);
}
?>
	</div>
	<?php 
do_action('woocommerce_product_thumbnails');
?>

</div>
开发者ID:pradeep-web,项目名称:brandt,代码行数:30,代码来源:product-image.php


示例10: widget

    /** @see WP_Widget */
    function widget($args, $instance)
    {
        global $woocommerce;
        $cache = wp_cache_get('widget_best_sellers', 'widget');
        if (!is_array($cache)) {
            $cache = array();
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Best Sellers', 'woocommerce') : $instance['title'], $instance, $this->id_base);
        if (!($number = (int) $instance['number'])) {
            $number = 10;
        } else {
            if ($number < 1) {
                $number = 1;
            } else {
                if ($number > 15) {
                    $number = 15;
                }
            }
        }
        $query_args = array('posts_per_page' => $number, 'post_status' => 'publish', 'post_type' => 'product', 'meta_key' => 'total_sales', 'orderby' => 'meta_value', 'no_found_rows' => 1);
        $query_args['meta_query'] = array();
        if (isset($instance['hide_free']) && 1 == $instance['hide_free']) {
            $query_args['meta_query'][] = array('key' => '_price', 'value' => 0, 'compare' => '>', 'type' => 'DECIMAL');
        }
        $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
        $query_args['meta_query'][] = $woocommerce->query->visibility_meta_query();
        $r = new WP_Query($query_args);
        if ($r->have_posts()) {
            ?>
		<?php 
            echo $before_widget;
            ?>
		<?php 
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<ul class="product_list_widget">
		<?php 
            while ($r->have_posts()) {
                $r->the_post();
                global $product;
                ?>
		<li><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                ?>
">
			<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('shop_thumbnail');
                } else {
                    echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $woocommerce->get_image_size('shop_thumbnail_image_width') . '" height="' . $woocommerce->get_image_size('shop_thumbnail_image_height') . '" />';
                }
                ?>
			<?php 
                if (get_the_title()) {
                    the_title();
                } else {
                    the_ID();
                }
                ?>
		</a> <?php 
                echo $product->get_price_html();
                ?>
</li>
		<?php 
            }
            ?>
		</ul>
		<?php 
            echo $after_widget;
        }
        $content = ob_get_clean();
        if (isset($args['widget_id'])) {
            $cache[$args['widget_id']] = $content;
        }
        echo $content;
        wp_cache_set('widget_best_sellers', $cache, 'widget');
    }
开发者ID:eddiewilson,项目名称:new-ke,代码行数:89,代码来源:widget-best_sellers.php


示例11: dhwc_product_brand_column

/**
 * Thumbnail column value added to brand admin.
 *
 * @access public
 * @param mixed $columns
 * @param mixed $column
 * @param mixed $id
 * @return void
 */
function dhwc_product_brand_column($columns, $column, $id)
{
    global $woocommerce;
    if ($column == 'thumb') {
        $image = '';
        $thumbnail_id = get_woocommerce_term_meta($id, 'thumbnail_id', true);
        if ($thumbnail_id) {
            $image = wp_get_attachment_thumb_url($thumbnail_id);
        } else {
            $image = woocommerce_placeholder_img_src();
        }
        $columns .= '<img src="' . $image . '" alt="Thumbnail" class="wp-post-image" height="48" width="48" />';
    }
    return $columns;
}
开发者ID:jmead,项目名称:trucell-cms,代码行数:24,代码来源:dhwc-brand-admin.php


示例12: widget

    /**
     * (non-PHPdoc)
     * @see wp-includes/WP_Widget::widget()
     */
    public function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Brands', DH_DOMAIN) : $instance['title'], $instance, $this->id_base);
        $o = isset($instance['orderby']) ? $instance['orderby'] : 'order';
        $h = $instance['hide_empty'] ? true : false;
        if ($o == 'name') {
            $order = 'asc';
        } else {
            $order = 'desc';
        }
        $brands = get_terms('product_brand', array('hide_empty' => $h, 'orderby' => $o, 'order' => $order));
        if (!$brands) {
            return;
        }
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
		<div class="product-brand-slide">
			<ul id="pb-<?php 
        echo $args['widget_id'];
        ?>
" class="list-brand">
				<?php 
        foreach ($brands as $brand) {
            ?>
				<?php 
            $thumbnail = dhwc_get_product_brand_thumbnail_url($brand->term_id);
            if (!$thumbnail) {
                $thumbnail = woocommerce_placeholder_img_src();
            }
            ?>
				<li class="item">
					<a title="<?php 
            echo $brand->name;
            ?>
" href="<?php 
            echo get_term_link($brand->slug, 'product_brand');
            ?>
">
						<img alt="<?php 
            echo $brand->name;
            ?>
" src="<?php 
            echo $thumbnail;
            ?>
">
					</a>
					<h2><a title="<?php 
            echo $brand->name;
            ?>
" href="<?php 
            echo get_term_link($brand->slug, 'product_brand');
            ?>
"><?php 
            echo $brand->name;
            ?>
</a></h2>
				</li>
				<?php 
        }
        ?>
			</ul>
		</div>
		<script type="text/javascript">
		<!--
		jQuery(document).ready(function($){
			$('#pb-<?php 
        echo $args['widget_id'];
        ?>
').bxSlider();
		});
		//-->
		</script>
		<?php 
        echo $after_widget;
    }
开发者ID:mysia84,项目名称:mnassalska,代码行数:83,代码来源:dhwc-widget-slider-brands.php


示例13: load_product_content_callback

    public function load_product_content_callback()
    {
        $prod_id = absint($_GET['product_id']);
        $this->id = $prod_id;
        global $post, $product, $woocommerce;
        $post = get_post($prod_id);
        $product = get_product($prod_id);
        if ($prod_id <= 0) {
            die('Invalid Products');
        }
        if (!isset($post->post_type) || strcmp($post->post_type, 'product') != 0) {
            die('Invalid Products');
        }
        add_filter('woocommerce_add_to_cart_url', array($this, 'update_qs_add_to_cart_url'), 10);
        remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 1000);
        remove_action('woocommerce_product_thumbnails', 'woocommerce_template_single_sharing', 50);
        global $wd_data;
        if (isset($wd_data['wd_catelog_mod']) && $wd_data['wd_catelog_mod'] == 0) {
            remove_action('wd_quickshop_single_product_summary', 'woocommerce_template_single_add_to_cart', 11);
        }
        ob_start();
        ?>
		
	
		<div itemscope itemtype="http://schema.org/Product" id="product-<?php 
        echo get_the_ID();
        ?>
" class="wd_quickshop product">
				
				<div class="images">
				<?php 
        do_action('wd_qs_before_product_image');
        ?>
		
				<?php 
        if (has_post_thumbnail()) {
            $image_title = esc_attr($product->get_title());
            $image = get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'), array('alt' => $image_title, 'title' => $image_title));
            $image_link = wp_get_attachment_url(get_post_thumbnail_id());
            $attachment_count = count($product->get_gallery_attachment_ids());
            echo apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" class="woocommerce-main-image cloud-zoom zoom wd_qs_main_image" title="%s"  id=\'qs-zoom\' rel="position:\'right\',showTitle:1,titleOpacity:0.5,lensOpacity:0.5,fixWidth:362,fixThumbWidth:72,fixThumbHeight:72,adjustX: 0, adjustY:0">%s</a>', $image_link, $image_title, $image), $post->ID);
        } else {
            echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" class="attachment-shop_single wp-post-image wd_qs_main_image" />';
        }
        $attachment_ids = $product->get_gallery_attachment_ids();
        if ($attachment_ids) {
            ?>
						
						<div class="thumbnails list_carousel">
					
							<ul class="qs-thumbnails">
							
								<?php 
            if (has_post_thumbnail()) {
                array_unshift($attachment_ids, get_post_thumbnail_id($post->ID));
            }
            $loop = 0;
            $columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
            foreach ($attachment_ids as $attachment_id) {
                $wrapClasses = array('quickshop-thumb-' . $columns . 'col', 'wd_quickshop_thumb', 'pop_cloud_zoom cloud-zoom-gallery');
                $classes = array('attachment-shop_thumbnail');
                if ($loop == 0 || $loop % $columns == 0) {
                    $wrapClasses[] = 'first';
                }
                if ($loop == 0) {
                    $wrapClasses[] = 'firstThumb';
                }
                if (($loop + 1) % $columns == 0) {
                    $wrapClasses[] = 'last';
                }
                $image_class = esc_attr(implode(' ', $classes));
                $lrgImg = wp_get_attachment_image_src($attachment_id, 'shop_single');
                $lrgImg_full = wp_get_attachment_image_src($attachment_id, 'full');
                echo '<li><a href="' . $lrgImg_full[0] . '"rel="useZoom: \'qs-zoom\', smallImage: \'' . $lrgImg[0] . '\'"  class="' . esc_attr(implode(' ', $wrapClasses)) . '">' . wp_get_attachment_image($attachment_id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'), false, array('class' => $image_class)) . '</a></li>';
                $loop++;
            }
            ?>
								</ul>
								<div class="slider_control">
									<a id="qs_thumbnails_prev" class="prev" href="#">&lt;</a>
									<a id="qs_thumbnails_next" class="next" href="#">&gt;</a>
								</div>	
						</div>
						<?php 
        }
        ?>
				
					<div class="details_view">
						<a href="<?php 
        echo the_permalink();
        ?>
" title="<?php 
        _e('View Details', 'wpdance');
        ?>
" ><?php 
        _e('View Details', 'wpdance');
        ?>
</a>
					</div>
					
//.........这里部分代码省略.........
开发者ID:proj-2014,项目名称:vlan247-test-wp2,代码行数:101,代码来源:wd_quickshop.php


示例14: array

	<div id="<?php 
echo $this->slug . '_images';
?>
" class="royalSlider rsMinW">
	
		<?php 
$prodImgs = array();
if (has_post_thumbnail()) {
    $imgId = get_post_thumbnail_id();
    $prodImgs[$imgId]['slideId'][] = '-0-';
    $prodImgs[$imgId]['imgSrc'] = wp_get_attachment_image_src(get_post_thumbnail_id(), apply_filters('single_product_large_thumbnail_size', 'shop_single'));
    $prodImgs[$imgId]['imgThumbSrc'] = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail');
} else {
    $prodImgs[0]['slideId'][] = '-0-';
    $prodImgs[0]['imgSrc'] = woocommerce_placeholder_img_src();
    $prodImgs[0]['imgThumbSrc'] = woocommerce_placeholder_img_src();
}
// Additional Images
$attachIds = $product->get_gallery_attachment_ids();
$attachment_count = count($attachIds);
if (!empty($attachIds)) {
    foreach ($attachIds as $attachId) {
        $prodImgs[$attachId]['slideId'][] = '-0-';
        $prodImgs[$attachId]['imgSrc'] = wp_get_attachment_image_src($attachId, apply_filters('single_product_large_thumbnail_size', 'shop_single'));
        $prodImgs[$attachId]['imgThumbSrc'] = wp_get_attachment_image_src($attachId, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'));
    }
}
// !If is Varibale product
if ($product->product_type == 'variable') {
    $prodVars = $product->get_available_variations();
    if (!empty($prodVars)) {
开发者ID:Qualitair,项目名称:ecommerce,代码行数:31,代码来源:qv-images.php


示例15: get_option

<?php

/**
 * Single Product Image
 *
 * @author 		YIThemes
 * @package 	YITH_Magnifier/Templates
 * @version     1.1.2
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $post, $woocommerce, $product, $is_IE;
$enable_slider = get_option('yith_wcmg_enableslider') == 'yes' ? true : false;
$placeholder = function_exists('wc_placeholder_img_src') ? wc_placeholder_img_src() : woocommerce_placeholder_img_src();
$slider_items = get_option('yith_wcmg_slider_items', 3);
if (!isset($slider_items) || $slider_items == null) {
    $slider_items = 3;
}
?>

<?php 
$attachment_ids = $product->get_gallery_attachment_ids();
if (!empty($attachment_ids)) {
    $imageclass = 'hasthumb';
} else {
    $imageclass = 'nothumb';
}
?>
<div class="images<?php 
开发者ID:roadthemez,项目名称:roadthemes,代码行数:31,代码来源:product-image-magnifier.php


示例16: admin_fields_upload_tabs

        public function admin_fields_upload_tabs($value)
        {
            $upload_value = get_option($value['id']) !== false && get_option($value['id']) !== null ? esc_attr(stripslashes(get_option($value['id']))) : esc_attr($value['std']);
            ?>
<tr valign="top">
				<th scope="row" class="titledesc">
					<label for="<?php 
            echo esc_attr($value['id']);
            ?>
"><?php 
            echo $value['name'];
            ?>
</label>
				</th>
				<td class="forminp">
					<div class="form-field">
                        <div id="tabs_thumbnail" style="float:left;margin-right:10px;"><img src="<?php 
            echo $upload_value != '' ? wp_get_attachment_thumb_url($upload_value) : woocommerce_placeholder_img_src();
            ?>
" width="60px" height="60px" /></div>
                        <div style="line-height:60px;">
                            <input type="hidden" id="<?php 
            echo esc_attr($value['id']);
            ?>
" name="<?php 
            echo esc_attr($value['id']);
            ?>
" value="<?php 
            echo $upload_value;
            ?>
" />
                            <button type="button" class="upload_image_button button"><?php 
            _e('Upload/Add image', EXTRA_WOO_TABS_TEXTDOMAN);
            ?>
</button>
                            <button type="button" class="remove_image_button button"><?php 
            _e('Remove image', EXTRA_WOO_TABS_TEXTDOMAN);
            ?>
</button>
                        </div>
                        
                        <div class="clear"></div>
                    </div>	
					<?php 
            echo $value['desc'];
            ?>
                </td>
			</tr>
			

			
			<script type="text/javascript">
			jQuery(document).ready(function(){
				
				 // Only show the "remove image" button when needed
				 if ( ! jQuery('#pw_woocommerce_tabs_default_image').val() )
					 jQuery('.remove_image_button').hide();
	
				// Uploading files
				var file_frame;
	
				jQuery(document).on( 'click', '.upload_image_button', function( event ){

					event.preventDefault();
	
					// If the media frame already exists, reopen it.
					if ( file_frame ) {
						file_frame.open();
						return;
					}
					// Create the media frame.
					file_frame = wp.media.frames.downloadable_file = wp.media({
						title: '<?php 
            _e('Choose an image', EXTRA_WOO_TABS_TEXTDOMAN);
            ?>
',
						button: {
							text: '<?php 
            _e('Use image', EXTRA_WOO_TABS_TEXTDOMAN);
            ?>
',
						},
						multiple: false
					});
	
					// When an image is selected, run a callback.
					file_frame.on( 'select', function() {
						attachment = file_frame.state().get('selection').first().toJSON();
	
						jQuery('#pw_woocommerce_tabs_default_image').val( attachment.id );
						jQuery('#tabs_thumbnail img').attr('src', attachment.url );
						jQuery('.remove_image_button').show();
					});
	
					// Finally, open the modal.
					file_frame.open();
				});
	
				jQuery(document).on( 'click', '.remove_image_button', function( event ){
					jQuery('#tabs_thumbnail img').attr('src', '<?php 
//.........这里部分代码省略.........
开发者ID:EliasGoldberg,项目名称:troop-sim,代码行数:101,代码来源:setting-tabs.php


示例17: woocommerce_placeholder_img

/**
 * Get the placeholder image
 *
 * @access public
 * @return string
 */
function woocommerce_placeholder_img($size = 'shop_thumbnail')
{
    global $woocommerce;
    $dimensions = $woocommerce->get_image_size($size);
    return apply_filters('woocommerce_placeholder_img', '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" />');
}
开发者ID:iplaydu,项目名称:Bob-Ellis-Shoes,代码行数:12,代码来源:woocommerce-core-functions.php


示例18: do_javascript

    private function do_javascript()
    {
        global $woocommerce;
        ob_start();
        ?>
		jQuery(document).ready(function($) {
		var current_field_wrapper;

		window.send_to_editor_default = window.send_to_editor;

		jQuery('#swatches').on('click', '.upload_image_button, .remove_image_button', function() {

		var post_id = jQuery(this).attr('rel');
		var parent = jQuery(this).parent();
		current_field_wrapper = parent;

		if (jQuery(this).is('.remove_image_button')) {

		jQuery('.upload_image_id', current_field_wrapper).val('');
		jQuery('img', current_field_wrapper).attr('src', '<?php 
        echo woocommerce_placeholder_img_src();
        ?>
');
		jQuery(this).removeClass('remove');

		} else {

		window.send_to_editor = window.send_to_pidroduct;
		formfield = jQuery('.upload_image_id', parent).attr('name');
		tb_show('', 'media-upload.php?&amp;type=image&amp;TB_iframe=true');
		}

		return false;
		});

		window.send_to_pidroduct = function(html) {

		jQuery('body').append('<div id="temp_image">' + html + '</div>');

		var img = jQuery('#temp_image').find('img');

		imgurl 		= img.attr('src');
		imgclass 	= img.attr('class');
		imgid		= parseInt(imgclass.replace(/\D/g, ''), 10);

		jQuery('.upload_image_id', current_field_wrapper).val(imgid);
		jQuery('img', current_field_wrapper).attr('src', imgurl);
		var $preview = jQuery(current_field_wrapper).closest('div.sub_field').find('.swatch-wrapper');
		jQuery('img', $preview).attr('src', imgurl);
		tb_remove();
		jQuery('#temp_image').remove();

		window.send_to_editor = window.send_to_editor_default;
		}



		});

		<?php 
        $javascript = ob_get_clean();
        WC_Swatches_Compatibility::wc_enqueue_js($javascript);
    }
开发者ID:AndyA,项目名称:River,代码行数:63,代码来源:class-wc-swatches-product-data-tab.php


示例19: yit_image

			<a itemprop="image" href="<?php 
        yit_image('size=shop_magnifier&output=url');
        ?>
" class="yith_magnifier_zoom" rel="thumbnails"><?php 
        yit_image(array('size' => apply_filters('single_product_large_thumbnail_size', 'shop_single')));
        ?>
</a>
			
		<?php 
    } else {
        ?>

			
			<img src="<?php 
        echo woocommerce_placeholder_img_src();
        ?>
" alt="Placeholder" />
			
		<?php 
    }
    ?>

		
	<?php 
}
?>



	<?php 
开发者ID:GaryJones,项目名称:goombiel,代码行数:30,代码来源:product-image-magnifier.php


示例20: esc_attr

			</tr>
			<tr>
				<td class="upload_image">
					<a href="#" class="upload_image_button <?php 
if ($image_id > 0) {
    echo 'remove';
}
?>
" rel="<?php 
echo esc_attr($variation_id);
?>
"><img src="<?php 
if (!empty($image)) {
    echo esc_attr($image);
} else {
    echo esc_attr(woocommerce_placeholder_img_src());
}
?>
" /><input type="hidden" name="upload_image_id[<?php 
echo $loop;
?>
]" class="upload_image_id" value="<?php 
echo esc_attr($image_id);
?>
" /><span class="overlay"></span></a>
				</td>
				<td class="options">
					<label><input type="checkbox" class="checkbox" name="variable_enabled[<?php 
echo $loop;
?>
]" <?php 
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:31,代码来源:variation-admin-html.php




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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