Example #1
0
    function kt_woocommerce_single_product()
    {
        ?>
        <div class="product-detail-info">
            <div class="product-section">
                <?php 
        woocommerce_template_single_meta();
        woocommerce_template_single_rating();
        woocommerce_template_single_excerpt();
        ?>
            </div>
            <div class="product-section">
                <?php 
        woocommerce_template_single_add_to_cart();
        ?>
                <div class="group-product-price">
                    <label><?php 
        esc_html_e('Price', 'kutetheme');
        ?>
</label>
                    <?php 
        woocommerce_template_single_price();
        ?>
                </div>
            </div>
            <div class="product-section">
                <?php 
        woocommerce_template_single_sharing();
        ?>
            </div>
        </div>
        <?php 
    }
    public function widget($args, $instance)
    {
        extract($args);
        global $wpdb, $post;
        $title = apply_filters('widget_title', $instance['title']);
        $post_num = isset($instance['post-quantity']) ? $instance['post-quantity'] : 5;
        $post_type = isset($instance['post-type']) ? $instance['post-type'] : 'post';
        $sort_by = isset($instance['sort-by']) ? $instance['sort-by'] : 'date';
        $sort_order = isset($instance['sort-order']) ? $instance['sort-order'] : false;
        if ($sort_order) {
            $order = 'ASC';
        } else {
            $order = 'DESC';
        }
        $show_date = isset($instance['date']) ? $instance['date'] : false;
        $show_comments = isset($instance['comments']) ? $instance['comments'] : false;
        $categories = isset($instance['category']) ? $instance['category'] : '';
        $show_excerpt = isset($instance['excerpt']) ? $instance['excerpt'] : false;
        $excerpt_length = isset($instance['excerpt-length']) ? $instance['excerpt-length'] : 10;
        $excerpt_more = isset($instance['excerpt-more']) ? $instance['excerpt-more'] : '...read more';
        // Excerpt filters
        $new_excerpt_more = create_function('$more', 'return " ";');
        add_filter('excerpt_more', $new_excerpt_more);
        $new_excerpt_length = create_function('$length', 'return "' . $excerpt_length . '";');
        if ($excerpt_length > 0) {
            add_filter('excerpt_length', $new_excerpt_length);
        }
        $show_thumb = isset($instance['thumb']) ? $instance['thumb'] : false;
        $show_price = isset($instance['price']) ? $instance['price'] : false;
        $cur_postID = $post->ID;
        // The Query
        $query_args = array('ignore_sticky_posts' => 1, 'posts_per_page' => $post_num, 'orderby' => $sort_by, 'order' => $order, 'post_type' => $post_type, 'post_status' => 'publish', 'cat' => $categories);
        $the_query = new WP_Query($query_args);
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        echo '<ul class="recent-post-list">';
        while ($the_query->have_posts()) {
            $the_query->the_post();
            // Frontend Output
            ?>
 
			<li class="recent-post-item">

				<?php 
            if ($show_thumb && has_post_thumbnail()) {
                ?>
				<div class="thumb-wrapper">
					<a class="recent-posts-img-link" rel="bookmark" href="<?php 
                the_permalink();
                ?>
" title="Click to learn more about <?php 
                the_title();
                ?>
">
						<?php 
                the_post_thumbnail('shortcode-thumb-short');
                ?>
					</a>
				</div>
				<?php 
            }
            // Post Thumbnail
            ?>

				<h4>
					<a href="<?php 
            the_permalink();
            ?>
" class="nav-button" rel="bookmark" title="Click to learn more about <?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a>
				</h4>

				<?php 
            if ($show_date || $show_comments) {
                ?>
				<div class="recent-posts-entry-meta">

					<?php 
                if ($show_date) {
                    ?>
						<div class="post-date"><?php 
                    the_time('F jS, Y');
                    ?>
<span class="post-author"> by <?php 
                    the_author_posts_link();
                    ?>
</span></div>
					<?php 
                }
                // Post Date & Author
                ?>

					<?php 
                if ($show_comments) {
                    ?>
						<div class="comments-qty"><?php 
                    comments_popup_link('No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post');
                    ?>
</div>
					<?php 
                }
                // Post Comments
                ?>

				</div>
				<?php 
            }
            ?>

				<?php 
            if ($show_excerpt) {
                ?>
				<div class="recent-posts-entry-content"><?php 
                the_excerpt();
                ?>
					<a href="<?php 
                the_permalink();
                ?>
" class="more-link" rel="bookmark" title="Read more about <?php 
                the_title();
                ?>
"><?php 
                echo $excerpt_more;
                ?>
</a>
				</div> 
				<?php 
            }
            // Post Content
            ?>

				<?php 
            if ($show_price && $post_type != 'product') {
                continue;
            } else {
                if ($post_type === 'product') {
                    echo '<div class="product-price">';
                    woocommerce_template_single_price();
                    echo '</div>';
                    // Product Price if WOO
                } elseif ($post_type === 'wpsc-product') {
                    echo '<div class="product-price">';
                    wpsc_the_product_price_display();
                    echo '</div>';
                    // Product Price if WPEC
                } else {
                    continue;
                }
            }
            ?>

			</li>
		<?php 
        }
        echo '</ul>';
        echo $after_widget;
        wp_reset_postdata();
    }
 function thb_single_product_mobile_header()
 {
     echo "<div class='thb_product_mobile_header'>";
     woocommerce_template_single_title();
     woocommerce_template_loop_rating();
     woocommerce_template_single_price();
     echo "</div>";
 }
Example #4
0
                <div class="summary entry-summary">
                    <?php 
/**
 * woocommerce_single_product_summary hook
 *
 * @hooked woocommerce_template_single_title - 5
 * @hooked woocommerce_template_single_rating - 10
 * @hooked woocommerce_template_single_price - 10
 * @hooked woocommerce_template_single_excerpt - 20
 * @hooked woocommerce_template_single_add_to_cart - 30
 * @hooked woocommerce_template_single_meta - 40
 * @hooked woocommerce_template_single_sharing - 50
 */
woocommerce_template_single_title();
woocommerce_template_single_rating();
woocommerce_template_single_price();
woocommerce_template_single_excerpt();
?>
                        <div class="cart">
                            <?php 
woocommerce_template_loop_add_to_cart();
?>
                        </div>
                    <?php 
woocommerce_template_single_meta();
?>
                </div>
			</div>
		</div>
	</div>
</div><!-- #product-<?php 
Example #5
0
function yit_load_product_quick_view_ajax()
{
    if (!isset($_REQUEST['item_id'])) {
        die;
    }
    $product_id = intval($_REQUEST['item_id']);
    // set the main wp query for the product
    wp('p=' . $product_id . '&post_type=product');
    // remove parts from single product page
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10);
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50);
    remove_all_actions('woocommerce_after_single_product_summary');
    remove_all_actions('woocommerce_after_single_product');
    // change template for variable products
    if (isset($GLOBALS['yith_wccl'])) {
        $GLOBALS['yith_wccl']->obj = new YITH_WCCL_Frontend(YITH_WCCL_VERSION);
        $GLOBALS['yith_wccl']->obj->override();
    }
    //wp_head();
    while (have_posts()) {
        the_post();
        ?>

        <?php 
        woocommerce_template_single_title();
        ?>
        <?php 
        woocommerce_template_single_rating();
        ?>
        <?php 
        woocommerce_template_single_price();
        ?>

        <div class="single-product woocommerce">

            <?php 
        wc_get_template_part('content', 'single-product');
        ?>

        </div>

    <?php 
    }
    // end of the loop.
    //wp_footer();
    die;
}
Example #6
0
function avia_title($post = "", $_product = "", $title = "")
{
    if (!$_product) {
        global $product;
        $_product = $product;
    }
    if (!$title) {
        $title = get_the_title();
    }
    echo "<div class='title_container'>";
    if (!is_front_page()) {
        echo avia_breadcrumbs();
    }
    echo '<h1 class="page-title">' . $title . '</h1>';
    if ($_product && is_singular()) {
        echo '<span class="amount" style="color: #662D91; font-size: 20px;">' . $_product->get_sku() . '</span>';
        echo "<div class='price_container'>";
        woocommerce_template_single_price($post, $_product);
        echo "</div>";
    }
    echo "</div>";
}
    public static function actionSingleProduct()
    {
        if (static::getPrice() < static::$priceGreaterThanOrEqualTo) {
            woocommerce_template_single_price();
            return;
        }
        $product = get_product();
        ?>
    <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
      <p class="price"><?php 
        echo $product->get_price_html();
        ?>
        <span class="francotecnologia_wc_parcpagseg_single_product_price_span">
          <?php 
        echo (static::getPrice() > 0 ? static::$language['or'] . ' ' : '') . static::getParceledValue();
        ?>
        </span>
      </p>
      <?php 
        if ($product->product_type != 'variable') {
            echo static::getParceledTable();
        } else {
            $variationList = $product->get_available_variations();
            foreach ($variationList as $variation) {
                $productVariation = new WC_Product_Variation($variation['variation_id']);
                $defaultVariation = array_diff($variation['attributes'], $product->get_variation_default_attributes());
                echo static::getParceledTable($productVariation->get_price(), $variation['variation_id'], empty($defaultVariation));
            }
        }
        ?>
      <meta itemprop="price" content="<?php 
        echo $product->get_price();
        ?>
" />
      <meta itemprop="priceCurrency" content="<?php 
        echo get_woocommerce_currency();
        ?>
" />
      <link itemprop="availability" href="http://schema.org/<?php 
        echo $product->is_in_stock() ? static::$language['InStock'] : static::$language['OutOfStock'];
        ?>
" />
    </div>
    <?php 
    }
Example #8
0
function avia_title($post = "", $_product = "", $title = "")
{
    if (!$_product) {
        global $product;
        $_product = $product;
    }
    if (!$title) {
        $title = get_the_title();
    }
    echo "<div class='title_container'>";
    if (!is_front_page()) {
        echo avia_breadcrumbs();
    }
    echo '<h1 class="page-title">' . $title . '</h1>';
    if ($_product && is_singular()) {
        echo "<div class='price_container'>";
        woocommerce_template_single_price($post, $_product);
        echo "</div>";
    }
    echo "</div>";
}
Example #9
0
function tokopress_wc_before_single_variation()
{
    global $product;
    $from = false;
    $saleprices = array($product->get_variation_price('min', true), $product->get_variation_price('max', true));
    if ($saleprices[0] !== $saleprices[1]) {
        $from = true;
    }
    $regprices = array($product->get_variation_regular_price('min', true), $product->get_variation_regular_price('max', true));
    if ($regprices[0] !== $regprices[1]) {
        $from = true;
    }
    if (!$from) {
        woocommerce_template_single_price();
    }
}