示例#1
0
/**
 * Shows product description
 *
 * @param type $atts
 * @return string
 */
function ic_product_description($atts)
{
    $args = shortcode_atts(array('product' => get_the_ID()), $atts);
    $product_description = get_product_description($args['product']);
    return apply_filters('the_content', $product_description);
}
示例#2
0
/**
 * Checks if product has long description
 *
 * @param int $product_id
 * @return boolean
 */
function has_product_description($product_id)
{
    $desc = get_product_description($product_id);
    if (!empty($desc)) {
        return true;
    } else {
        return false;
    }
}
function show_product_description($post, $single_names)
{
    $product_description = get_product_description($post->ID);
    if (!empty($product_description)) {
        ?>
		<div class="product-description"><?php 
        if (get_integration_type() == 'simple') {
            echo apply_filters('product_simple_description', $product_description);
        } else {
            echo apply_filters('the_content', $product_description);
        }
        ?>
		</div>
		<?php 
    }
}
示例#4
0
function simple_prepare_products_to_export()
{
    $products = simple_get_all_exported_products();
    $fields = array();
    $fields[1]['image_url'] = __('Image URL', 'al-product-csv');
    $fields[1]['product_name'] = __('Product Name', 'al-product-csv');
    $fields[1]['product_price'] = __('Product Price', 'al-product-csv');
    $fields[1]['product_categories'] = __('Product Categories', 'al-product-csv');
    $fields[1]['product_short_desc'] = __('Short Description', 'al-product-csv');
    $fields[1]['product_desc'] = __('Long Description', 'al-product-csv');
    $z = 2;
    foreach ($products as $product) {
        $image = wp_get_attachment_image_src(get_post_thumbnail_id($product->ID), 'full');
        $desc = get_product_description($product->ID);
        $short_desc = get_product_short_description($product->ID);
        $fields[$z]['image_url'] = $image[0];
        $fields[$z]['product_name'] = $product->post_title;
        $fields[$z]['product_price'] = get_post_meta($product->ID, '_price', true);
        $category_array = get_the_terms($product->ID, 'al_product-cat');
        $category = array();
        if (!empty($category_array)) {
            foreach ($category_array as $p_cat) {
                $value = html_entity_decode($p_cat->name);
                $category[] = $value;
            }
        }
        $fields[$z]['product_categories'] = implode(' | ', $category);
        $fields[$z]['product_short_desc'] = $short_desc;
        $fields[$z]['product_desc'] = $desc;
        $z++;
    }
    return array_filter($fields);
}
function al_product_desc()
{
    global $post;
    echo '<input type="hidden" name="descmeta_noncename" id="descmeta_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
    $desc = get_product_description($post->ID);
    $desc_settings = array('textarea_rows' => 30);
    wp_editor($desc, 'content', $desc_settings);
}
示例#6
0
                            <img src="<?php 
        echo get_thumbnail($products->post->ID);
        ?>
" alt="" />
                            <div class="product-info">
                              <h3><?php 
        echo get_the_title();
        ?>
</h3>
                              <a href="<?php 
        echo get_product_link($post->ID);
        ?>
" target="_blank">Learn More &gt;</a>
                            </div>
                            <p class="product-description"><?php 
        echo get_product_description($post->ID);
        ?>
 <br/><br/><br/><br/><br/></p>
                          </div>
                      <?php 
    }
    ?>
                  <?php 
}
?>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
<?php

if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
/**
 * The template to display product description on product page or with a shortcode
 *
 * Copy it to your theme implecode folder to edit the output: your-theme-folder-name/implecode/product-description.php
 *
 * @version		1.1.2
 * @package		ecommerce-product-catalog/templates/template-parts/product-page
 * @author 		Norbert Dreszer
 */
$product_id = ic_get_product_id();
$product_description = get_product_description($product_id);
if (!empty($product_description)) {
    ?>
	<div class="product-description"><?php 
    if (get_integration_type() == 'simple') {
        echo apply_filters('product_simple_description', $product_description);
    } else {
        echo apply_filters('the_content', $product_description);
    }
    ?>
	</div>
	<?php 
}