本文整理汇总了PHP中woocommerce_show_product_loop_sale_flash函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_show_product_loop_sale_flash函数的具体用法?PHP woocommerce_show_product_loop_sale_flash怎么用?PHP woocommerce_show_product_loop_sale_flash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_show_product_loop_sale_flash函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: foreach
if ($terms) {
foreach ($terms as $cat) {
$classes .= ' ' . $cat->slug;
}
}
?>
<div class="grid-item<?php
echo $product->is_on_sale() ? ' sale' : '';
echo $classes;
?>
">
<?php
$thumbnal_id = get_post_thumbnail_id($product->id);
$img = wp_get_attachment_image_src($thumbnal_id, 'shop_catalog', true);
echo '<a class="product-image" href="' . get_permalink($product->id) . '">';
woocommerce_show_product_loop_sale_flash();
if (has_post_thumbnail($product->id)) {
echo '<img src="' . placeImg($img[1], $img[2]) . '" alt="' . get_alt($thumbnal_id) . '" data-defer="' . $img[0] . '" class="aligncenter" width="' . $img[1] . '" height="' . $img[2] . '" />';
} else {
echo wc_placeholder_img('shop_catalog');
}
echo '</a>';
?>
<div class="product-data">
<a class="product-title" href="<?php
the_permalink();
?>
">
<h3><?php
echo get_the_title($product->id);
?>
开发者ID:Tusko,项目名称:WP-Anatomy,代码行数:31,代码来源:content-product.php
示例2: dhvc_woo_products_shortcode
//.........这里部分代码省略.........
}
$output .= '<div class="dhvc-woo-row-fluid dhvc-woo-' . $display . '-list"' . ($display == 'masonry' ? ' data-masonry-gutter="' . absint($masonry_gutter) . '"' : '') . '' . ($display == 'carousel' ? ' data-items="' . absint($post_per_row) . '"' : '') . ($display == 'carousel' && !empty($show_carousel_pagination) ? ' data-pagination="true"' : '') . '>';
if ($r->have_posts()) {
$i = 0;
while ($r->have_posts()) {
$r->the_post();
global $product, $post;
$cats = get_the_terms($product->id, 'product_cat');
$product_cats = array();
if (!empty($cats)) {
foreach ($cats as $cat) {
$product_cats[] = 'dhvc-woo-cat-' . $cat->term_id;
}
}
if ($display == 'grid') {
if ($i++ % $post_per_row == 0) {
$output .= '<div class="dhvc-woo-row-fluid">';
}
}
$output .= '<div class="dhvc-woo-item';
if ($display != 'carousel' && $display != 'list') {
$output .= ' dhvc-woo-span' . 12 / absint($post_per_row);
}
$output .= ' dhvc-woo-' . $display . '-item ' . implode(' ', $product_cats);
$output .= '">';
$output_image = '';
if ($hide_thumbnail !== '0') {
$output_image .= '<div class="dhvc-woo-images">';
if (defined('YITH_WCWL')) {
$output_image .= do_shortcode('[yith_wcwl_add_to_wishlist]');
}
if ($show_sale_flash !== '0' && $product->is_on_sale()) {
ob_start();
woocommerce_show_product_loop_sale_flash();
$output_image .= ob_get_clean();
}
if (function_exists('dhwcpl_product_sale')) {
ob_start();
dhwcpl_product_sale();
dhwcpl_product_out_of_store();
dhwcpl_shop_loop_item();
$output_image .= ob_get_clean();
}
if (has_post_thumbnail()) {
$image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
$image_link = esc_url(get_permalink());
$thumb_size = 'shop_catalog';
$thumbnail_image = get_the_post_thumbnail($post->ID, 'shop_catalog');
if (!empty($thumbnail_height) && !empty($thumbnail_width)) {
$thumb_size = $thumbnail_width . 'x' . $thumbnail_height;
$thumbnail_data = dhvc_woo_getImageBySize(array('post_id' => $product->id, 'thumb_size' => $thumb_size));
$thumbnail_image = $thumbnail_data['thumbnail'];
}
$output_image .= '<a href="' . $image_link . '" itemprop="image" title="' . $image_title . '" >' . $thumbnail_image . '</a>';
} else {
$output_image .= apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" title="%s"><img src="%s" alt="Placeholder" /></a>', esc_url(get_permalink()), $image_title, wc_placeholder_img_src()), $product->id);
}
$output_image .= '</div>';
}
$output .= apply_filters('dhvc_woo_images', $output_image, $product, $display);
$output .= '<div class="dhvc-woo-info"';
$image_config_size = absint($thumbnail_width);
if (empty($image_config_size)) {
$shop_single_image_arr = wc_get_image_size('shop_single');
$image_config_size = $shop_single_image_arr['width'];
}
开发者ID:jmead,项目名称:trucell-cms,代码行数:67,代码来源:class.php
示例3: strtolower
echo $itemsize;
?>
<?php
echo strtolower($tax);
?>
kad_product">
<div <?php
post_class($classes);
?>
>
<?php
do_action('woocommerce_before_shop_loop_item');
?>
<?php
echo woocommerce_show_product_loop_sale_flash($post, $product);
?>
<a href="<?php
the_permalink();
?>
" class="product_item_link product_img_link">
<?php
/**
* woocommerce_before_shop_loop_item_title hook
*
* @hooked woocommerce_show_product_loop_sale_flash - 10
* @hooked woocommerce_template_loop_product_thumbnail - 10
*/
do_action('woocommerce_before_shop_loop_item_title');
?>
开发者ID:Kang8M,项目名称:gaonhat,代码行数:31,代码来源:content-product.php
示例4: thb_loop_product_start
function thb_loop_product_start()
{
global $product;
echo "<div class='thb-product-image-wrapper item-thumb'>";
echo "<a href='" . get_permalink() . "'>";
woocommerce_show_product_loop_sale_flash();
if (!$product->is_in_stock()) {
echo "<span class='thb-out-of-stock'>";
_e('Out of stock', 'woocommerce');
echo "</span>";
}
echo "<span class='thb-overlay'></span>";
woocommerce_template_loop_product_thumbnail();
echo "</a>";
echo "</div>";
echo "<div class='thb-product-description'>";
}
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:17,代码来源:theme-woocommerce.php
示例5: woo_loop_product_thumbnail
/**
*
* Product thumbnail for loop
*/
function woo_loop_product_thumbnail()
{
if (has_post_thumbnail()) {
echo '<figure class="featured-image img-preload img-hover">';
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('shop_catalog');
echo '<div class="overlay"></div>';
echo '</a>';
woocommerce_template_loop_add_to_cart();
woocommerce_show_product_loop_sale_flash();
echo '</figure>';
}
}
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:17,代码来源:woo.php
示例6: kt_group_flash
function kt_group_flash()
{
?>
<div class="status">
<?php
kt_show_product_loop_new_flash();
woocommerce_show_product_loop_sale_flash();
?>
</div>
<?php
}
开发者ID:TruongTuyen,项目名称:thuctapcoso,代码行数:11,代码来源:woocommerce.php
示例7: venedor_woocommerce_thumbnail
function venedor_woocommerce_thumbnail()
{
global $product, $woocommerce, $venedor_settings;
$id = get_the_ID();
$size = 'shop_catalog';
$gallery = get_post_meta($id, '_product_image_gallery', true);
$attachment_image = '';
if ($venedor_settings['category-image-effect'] && !empty($gallery)) {
$gallery = explode(',', $gallery);
$first_image_id = $gallery[0];
$attachment_image = wp_get_attachment_image($first_image_id, $size, false, array('class' => 'hover-image'));
}
$thumb_image = get_the_post_thumbnail($id, $size);
$class = "product-image";
if (!$thumb_image) {
if (wc_placeholder_img_src()) {
$thumb_image = wc_placeholder_img($size);
}
}
if (!$attachment_image || !$venedor_settings['category-image-effect']) {
$class = "product-image no-image";
}
echo '<span class="' . $class . '">';
// show images
echo $attachment_image;
echo $thumb_image;
// show hot/sale label
woocommerce_show_product_loop_sale_flash();
// show price
if ($venedor_settings['product-price']) {
if ($product->get_price() != '') {
$variable_class = '';
if ($product->is_type(array('variable')) && $product->get_variation_price('min') !== $product->get_variation_price('max')) {
$variable_class = ' price-variable';
}
if ($product->is_type(array('grouped'))) {
$child_prices = array();
foreach ($product->get_children() as $child_id) {
$child_prices[] = get_post_meta($child_id, '_price', true);
}
$child_prices = array_unique($child_prices);
if (!empty($child_prices)) {
$variable_class = ' price-variable';
}
}
echo '<div class="price-box ' . $venedor_settings['product-price-pos'] . $variable_class . '">';
woocommerce_template_loop_price();
echo '</div>';
}
}
// show quick view
if ($venedor_settings['category-quickview']) {
?>
<div class="figcaption<?php
if (!$venedor_settings['category-hover']) {
echo ' no-hover';
}
?>
">
<span class="btn btn-arrow quickview-button <?php
echo $venedor_settings['category-quickview-pos'];
?>
" data-id="<?php
echo the_ID();
?>
"><span class="fa fa-search"></span></span>
</div>
<?php
}
echo '</span>';
}
开发者ID:robwri32,项目名称:garland,代码行数:71,代码来源:functions.php
注:本文中的woocommerce_show_product_loop_sale_flash函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论