本文整理汇总了PHP中woocommerce_show_product_sale_flash函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_show_product_sale_flash函数的具体用法?PHP woocommerce_show_product_sale_flash怎么用?PHP woocommerce_show_product_sale_flash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_show_product_sale_flash函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: x_woocommerce_shop_thumbnail
function x_woocommerce_shop_thumbnail()
{
global $product;
$id = get_the_ID();
$thumb = 'entry';
$rating = $product->get_rating_html();
woocommerce_show_product_sale_flash();
echo '<div class="entry-featured">';
echo '<a href="' . get_the_permalink() . '">';
echo get_the_post_thumbnail($id, $thumb);
if (!empty($rating)) {
echo '<div class="star-rating-container aggregate">' . $rating . '</div>';
}
echo '</a>';
echo "</div>";
}
开发者ID:ju4nr3v0l,项目名称:juandavidmarulanda.com,代码行数:16,代码来源:woocommerce.php
示例2: get_permalink
$loop->the_post();
global $product;
?>
<li class="product">
<a href="<?php
echo get_permalink($loop->post->ID);
?>
" title="<?php
echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID);
?>
">
<?php
woocommerce_show_product_sale_flash($post, $product);
?>
<?php
if (has_post_thumbnail($loop->post->ID)) {
echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog');
} else {
echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="300px" height="300px" />';
}
?>
<h3><?php
the_title();
?>
</h3>
开发者ID:qnk,项目名称:lessaggs,代码行数:30,代码来源:wc-loop-mainpage.php
示例3: do_action
$zoom_class = '';
}
?>
<div class="nm-product-thumbnails-col col-xs-1">
<?php
do_action('woocommerce_product_thumbnails');
?>
</div>
<div id="nm-product-images-col" class="nm-product-images-col <?php
echo esc_attr($image_column_class);
?>
">
<div class="images">
<?php
woocommerce_show_product_sale_flash();
?>
<div id="nm-product-images-slider" class="slick-slider slick-arrows-small">
<?php
// Featured image
if (has_post_thumbnail()) {
$image_title = esc_attr(get_the_title($post->ID));
$image = get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'), array('alt' => $image_title));
if ($modal_enabled || $zoom_enabled) {
$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
$image_icon = $has_featured_video ? 'nm-font-media-play' : 'nm-font-plus';
$image_wrap_open = sprintf('<a href="%s" class="nm-product-image-link zoom" data-size="%sx%s" itemprop="image">', esc_url($full_image[0]), intval($full_image[1]), intval($full_image[2]));
$image_wrap_close = '<i class="nm-product-image-icon nm-font ' . $image_icon . '"></i></a>';
} else {
$image_wrap_open = '';
开发者ID:tccyp001,项目名称:onemore-wordpress,代码行数:31,代码来源:product-image.php
示例4: mango_woo_product
//.........这里部分代码省略.........
</div><!-- End .col-md-3 -->
<!--******************** QUICK VIEW START ******************************-->
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
global $product, $woocommerce;
$product_cats = $product->get_categories(' | ', '', '');
$attachment_ids = $product->get_gallery_attachment_ids();
?>
<div id="product-popup_<?php
echo the_ID();
?>
" class="overlay-popup mypopup mfp-hide">
<div itemscope itemtype="<?php
echo woocommerce_get_product_schema();
?>
" id="product-<?php
the_ID();
?>
" <?php
post_class("row");
?>
>
<?php
//do_action( 'woocommerce_before_single_product_summary' );
?>
<div class="col-md-6 col-sm-6">
<div class="images product-gallery-container">
<div class="product-top ">
<?php
woocommerce_show_product_sale_flash();
if (has_post_thumbnail()) {
$image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
$image_caption = get_post(get_post_thumbnail_id())->post_excerpt;
$image_link = wp_get_attachment_url(get_post_thumbnail_id());
$image = get_the_post_thumbnail($post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single'), array('title' => $image_title, 'alt' => $image_title));
$image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
//single-product //
$image = $image['0'];
$zoom_img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$zoom_img = $zoom_img['0'];
echo apply_filters("woocommerce_single_product_image_html", sprintf('<img class="product-zoom" src="%s" data-zoom-image="%s" alt="%s"/>', $zoom_img, $zoom_img, $image_title), $post->ID);
} else {
echo apply_filters('woocommerce_single_product_image_html', sprintf('<img class="product-zoom" src="%s" data-zoom-image="%s" alt="%s" />', wc_placeholder_img_src(), wc_placeholder_img_src(), __('Placeholder', 'woocommerce')), $post->ID);
}
?>
</div>
<?php
// do_action( 'woocommerce_product_thumbnails' );
$attachment_ids = $product->get_gallery_attachment_ids();
if (has_post_thumbnail()) {
if (empty($attachment_ids)) {
$attachment_ids[] = get_post_thumbnail_id($post->ID);
} else {
array_unshift($attachment_ids, get_post_thumbnail_id($post->ID));
}
}
if ($attachment_ids) {
$loop = 0;
$columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
?>
<div class="product-gallery-wrapper thumbnails <?php
echo 'columns-' . $columns;
开发者ID:nickkoskowski,项目名称:Work-Depot,代码行数:67,代码来源:shortcodes.php
示例5: pmc_productBlock
//.........这里部分代码省略.........
}
?>
</div>
</div>
<?php
} else {
?>
<div class="recentimage">
<div class="image">
<div class="loading"></div>
<?php
if (has_post_thumbnail(get_the_ID())) {
echo '<img src = ' . $image . ' alt = "' . get_the_title() . '" > ';
} else {
echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="230px" height="' . $pmc_data['catalog_img_height'] . 'px" />';
}
?>
</div>
</div>
<?php
if ($product_ajax != 'true') {
?>
</a>
<?php
}
?>
<?php
}
?>
<div class="recentdescription">
<?php
woocommerce_show_product_sale_flash($product);
?>
<?php
if ($product_ajax != 'true') {
?>
<a href="<?php
echo get_permalink(get_the_id());
?>
">
<?php
}
?>
<h3><?php
the_title();
?>
</h3>
<?php
if ($product_ajax != 'true') {
?>
</a>
<?php
}
?>
</div>
<?php
if ($product_ajax == 'true') {
?>
</div>
<?php
}
?>
<div class="product-price-cart">
<div class="recentPrice"><span class="price"><?php
echo $product->get_price_html();
?>
</span></div>
<div class="recentCart"><?php
woocommerce_template_loop_add_to_cart($product);
?>
</div>
</div>
</div>
<?php
$countPost++;
if ($countitem == $rows) {
$countitem = 0;
?>
</li>
<?php
}
$countitem++;
}
}
wp_reset_query();
?>
</ul>
</div>
</div>
</div>
</div>
<?php
}
开发者ID:shimion,项目名称:sim-buller,代码行数:101,代码来源:custom_functions.php
示例6: widget
//.........这里部分代码省略.........
while ($loop->have_posts()) {
$loop->the_post();
global $product;
global $woocommerce;
$large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($loop->post->ID), apply_filters('single_product_large_thumbnail_size', 'shop_catalog'));
$productlink = get_permalink($loop->post->ID);
$content_excerpt = apply_filters('woocommerce_short_description', $loop->post->post_excerpt);
?>
<li class="product-grid-container">
<div class="product-item">
<div class="title">
<h3 class="title-container product-titles"><a href="<?php
echo $productlink;
?>
"><?php
the_title();
?>
</a></h3>
</div>
<div class="image mosaic-block bar">
<?php
if ($content_excerpt != "") {
?>
<a href="<?php
echo $productlink;
?>
" class="mosaic-overlay">
<div class="details">
<?php
echo $content_excerpt;
?>
</div>
</a><?php
}
?>
<a href="<?php
echo $productlink;
?>
">
<span class="price heading-style"><?php
echo $product->get_price_html();
?>
</span>
<?php
woocommerce_show_product_sale_flash($loop->post, $product);
?>
<?php
if (!$large_image_url == "") {
?>
<img src="<?php
echo $large_image_url[0];
?>
" alt="" /><?php
} else {
?>
<img src="<?php
echo woocommerce_placeholder_img_src();
?>
" width="240" height="160" alt="" /><?php
}
?>
</a>
</div>
<div class="info">
<div class="float-left">
<?php
woocommerce_template_loop_rating($loop->post, $product);
?>
</div>
<div class="float-right">
<?php
woocommerce_template_loop_add_to_cart($loop->post, $product);
?>
</div>
</div>
</div>
</li>
<?php
}
wp_reset_query();
?>
</ul>
<div id="pager<?php
echo $uni_carousel_id;
$uni_carousel_id++;
?>
" class="pager"></div>
<div class="clear"></div>
</div><?php
}
?>
</div>
<?php
}
开发者ID:phanhoanglong2610,项目名称:flowershop,代码行数:101,代码来源:mywidgets.php
示例7: widget
public function widget($args, $instance)
{
$title = apply_filters('widget_title', $instance['title']);
// before and after widget arguments are defined by themes
echo $args['before_widget'];
if (!empty($title)) {
echo $args['before_title'] . $title . $args['after_title'];
}
// This is where you run the code and display the output
$prod_cats = $this->get_product_categories();
if ($prod_cats == NULL) {
return NULL;
}
$index = 0;
?>
<div class="shop-sidebar-slider">
<div id="upw-carousel" class="carousel slide">
<!-- Controls -->
<a class="pull-right right carousel-control" href="#upw-carousel" role="button" data-slide="next">
<i class="icon-right-open-big" aria-hidden="true"></i>
<span class="sr-only"><?php
_e('Next', 'sage');
?>
</span>
</a>
<a class="pull-right left carousel-control" href="#upw-carousel" role="button" data-slide="prev">
<i class="icon-left-open-big" aria-hidden="true"></i>
<span class="sr-only"><?php
_e('Previous', 'sage');
?>
</span>
</a>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php
$args = array('post_type' => 'product', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $prod_cats)), 'orderby' => 'rand');
$loop = new WP_Query($args);
while ($loop->have_posts()) {
$loop->the_post();
$index++;
global $product;
global $post;
//need debug on sale product
?>
<article <?php
post_class('item ' . ($index == 1 ? 'active' : ''));
?>
>
<header>
<?php
woocommerce_show_product_sale_flash($post, $product);
?>
<figure class="entry-image">
<?php
if (has_post_thumbnail($loop->post->ID)) {
echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog');
} else {
echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="300px" height="300px" />';
}
?>
</figure>
<div class="entry-cat">
<?php
$product_cats = wp_get_post_terms(get_the_ID(), 'product_cat');
if ($product_cats && !is_wp_error($product_cats)) {
$single_cat = array_shift($product_cats);
echo $single_cat->name;
}
?>
</div>
<div class="entry-title"><?php
the_title();
?>
</div>
<a class="entry-link" href="<?php
echo get_permalink($loop->post->ID);
?>
"
title="<?php
echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID);
?>
">
<?php
_e('View Now', 'sage');
?>
►
</a>
</header>
</article>
<?php
}
?>
<?php
wp_reset_query();
?>
</div>
</div>
</div>
//.........这里部分代码省略.........
开发者ID:pnghai,项目名称:sage,代码行数:101,代码来源:extras.php
注:本文中的woocommerce_show_product_sale_flash函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论