本文整理汇总了PHP中wpsc_the_product_image函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsc_the_product_image函数的具体用法?PHP wpsc_the_product_image怎么用?PHP wpsc_the_product_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpsc_the_product_image函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: wpsc_the_product_image
?>
" 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
echo wpsc_the_product_image($image_width, $image_height);
?>
"/>
</a>
<?php
} else {
?>
<div class="item_no_image">
<a href="<?php
echo wpsc_the_product_permalink();
?>
">
<span>No Image Available</span>
</a>
</div>
开发者ID:Jonathonbyrd,项目名称:wp-ecommerce,代码行数:31,代码来源:single_product.php
示例3: str_replace
?>
">
<div class="textcol">
<?php
if (get_option('show_thumbnails')) {
?>
<div class="imagecol">
<?php
if (wpsc_the_product_thumbnail()) {
?>
<a rel="<?php
echo str_replace(array(" ", '"', "'", '"', '''), 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
echo wpsc_the_product_thumbnail();
?>
"/>
开发者ID:alx,项目名称:SimplePress,代码行数:31,代码来源:products_page.php
示例4: do_action
<?php endwhile; ?>
</div>
<?php endif; ?>
<?php do_action('wpsc_top_of_products_page'); // Plugin hook for adding things to the top of the products page, like the live search ?>
<div class="productdisplay">
<?php /** start the product loop here, this is single products view, so there should be only one */?>
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
<div class="single_product_display product_view_<?php echo wpsc_the_product_id(); ?>">
<div class="textcol">
<?php if(get_option('show_thumbnails')) :?>
<div class="imagecol">
<?php if(wpsc_the_product_thumbnail()) :?>
<a rel="<?php echo str_replace(array(" ", '"',"'", '"','''), 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 echo wpsc_the_product_image($image_width, $image_height); ?>" />
</a>
<?php else: ?>
<div class="item_no_image">
<a href="<?php echo wpsc_the_product_permalink(); ?>">
<span>No Image Available</span>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="producttext">
<h2 class="prodtitles"><span><?php echo wpsc_the_product_title(); ?></span><?php echo wpsc_edit_the_product_link(); ?></h2>
<?php
do_action('wpsc_product_before_description', wpsc_the_product_id(), $wpsc_query->product);
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:single_product.php
示例5: while
*/
while (wpsc_have_products()) {
wpsc_the_product();
?>
<div class="imagecol">
<?php
if (wpsc_the_product_thumbnail()) {
?>
<a rel="<?php
echo wpsc_the_product_title();
?>
" class="<?php
echo wpsc_the_product_image_link_classes();
?>
" href="<?php
echo esc_url(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
echo wpsc_the_product_thumbnail();
?>
"/>
开发者ID:dreamteam111,项目名称:dreamteam,代码行数:31,代码来源:wpsc-single_product.php
示例6: wpsc_total_product_count
Showing all <?php echo wpsc_total_product_count(); ?> products
<?php endif; ?>
</div>
<?php endif; ?>
<!-- End Pagination -->
<?php /** start the product loop here */?>
<?php while (wpsc_have_products()) : wpsc_the_product(); ?>
<div class="productdisplay default_product_display product_view_<?php echo wpsc_the_product_id(); ?> <?php echo wpsc_category_class(); ?>">
<div class="textcol">
<?php if(get_option('show_thumbnails')) :?>
<div class="imagecol">
<?php if(wpsc_the_product_thumbnail()) :?>
<a rel="<?php echo str_replace(array(" ", '"',"'", '"','''), 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 echo wpsc_the_product_thumbnail(); ?>" />
</a>
<?php else: ?>
<div class="item_no_image">
<a href="<?php echo wpsc_the_product_permalink(); ?>">
<span>No Image Available</span>
</a>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="producttext">
<h2 class="prodtitles">
<?php if(get_option('hide_name_link') == 1) : ?>
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:31,代码来源:products_page.php
示例7: str_replace
" title="<?php
echo str_replace(array(" ", '"', "'", '"', '''), array("_", "", "", "", ''), wpsc_the_product_title());
?>
"><img src="<?php
echo wpsc_the_product_image($new_width, $new_height);
?>
" alt="" /></a><br class="clear" />
</div>
<div class="image_thumb">
<ul>
<li>
<a href="<?php
echo wpsc_the_product_image($new_width, $new_height);
?>
" rel="main image"><img src="<?php
echo wpsc_the_product_image(120, 109);
?>
" alt="<?php
echo wpsc_the_product_title();
?>
" /></a>
</li>
<?php
$count = 1;
if (count($images) > 0) {
if ($images != null) {
foreach ($images as $image) {
$extra_imagepath = WPSC_IMAGE_DIR . $image['image'] . "";
$extra_image_size = @getimagesize($extra_imagepath);
$thickbox_link = WPSC_IMAGE_URL . $image['image'] . "";
$image_link = "index.php?image_id=" . $image['id'] . "&width=" . $new_width . "&height=" . $new_height . "";
开发者ID:BGCX261,项目名称:zombie-craft-svn-to-git,代码行数:31,代码来源:productgallery.php
示例8: get_post_thumbnail_id
if ($NV_datasource == 'data-5') {
if (class_exists('Woocommerce')) {
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);
开发者ID:ConceptHaus,项目名称:backup,代码行数:31,代码来源:post-categories-class.php
示例9: 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(" ", '"', "'", '"', '''), 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
示例10: wpsc_the_product_id
<div id="thickbox_<?php
echo wpsc_the_product_id();
?>
" style="display:none">
<div class="left_panel" style="display:block;float:left;width:434px;">
<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_image(400, 400);
?>
"/><br>
</div>
<div class="right_panel" style="display:block;float:left;">
<h1><?php
echo wpsc_the_product_title();
?>
</h1>
<?php
do_action('wpsc_product_before_description', wpsc_the_product_id(), $wpsc_query->product);
do_action('wpsc_product_addons', wpsc_the_product_id());
?>
<div class='wpsc_description'>
开发者ID:alx,项目名称:SBek-Arak,代码行数:31,代码来源:products_page.php
示例11: send_product
public function send_product()
{
if (wpsc_is_single_product()) {
$product = array();
while (wpsc_have_products()) {
wpsc_the_product();
$product_id = (int) wpsc_the_product_id();
$product['url'] = (string) wpsc_the_product_permalink();
$product['product_id'] = $product_id;
$product['name'] = (string) wpsc_the_product_title();
$product['image_url'] = (string) wpsc_the_product_image('', '', $product_id);
if (wpsc_product_has_variations($product_id)) {
$price = $this->get_lowest_product_variation_price($product_id);
} else {
$price = wpsc_calculate_price($product_id, false, true);
}
$product['price'] = $this->format_price($price);
if (wpsc_product_has_stock($product_id)) {
$product['stock'] = 1;
} else {
$product['stock'] = 0;
}
$product['categories'] = array();
$category_terms = wp_get_product_categories($product_id);
foreach ($category_terms as $category_term) {
$category_path = $category_term;
if (!empty($category_path)) {
$product['category_name'] = $category_term->name;
$product['category_id'] = $category_term->term_id;
}
}
if (wpsc_product_has_variations($product_id)) {
$list_price = $this->get_lowest_product_variation_price($product_id);
} else {
$list_price = wpsc_calculate_price($product_id, false, false);
}
$product['list_price'] = $this->format_price($list_price);
}
if (!empty($product)) {
$this->render('sendProduct', array('product' => $product));
}
}
}
开发者ID:retargeting,项目名称:WP-eCommerce,代码行数:43,代码来源:wpec-retargeting.php
注:本文中的wpsc_the_product_image函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论