예제 #1
0
 function widget($args, $instance)
 {
     if (is_ic_product_page()) {
         $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
         $related = get_related_products();
         if (!empty($related)) {
             echo $args['before_widget'];
             if ($title) {
                 echo $args['before_title'] . $title . $args['after_title'];
             }
             // Use current theme search form if it exists
             echo $related;
             echo $args['after_widget'];
         }
     }
 }
예제 #2
0
/**
 * Shows related products
 *
 * @param type $atts
 * @return string
 */
function ic_related_products($atts)
{
    $args = shortcode_atts(array('limit' => 3), $atts);
    return get_related_products($args['limit']);
}
예제 #3
0
/**
 * Shows related categories table on product page
 *
 * @param object $post
 * @param array $single_names
 * @param string $taxonomy_name
 * @return string
 */
function show_related_categories($post, $single_names, $taxonomy_name)
{
    $settings = get_multiple_settings();
    if ($settings['related'] == 'categories') {
        echo get_related_categories($post->ID, $single_names, $taxonomy_name);
    } else {
        echo get_related_products(null, true);
    }
}
</a>
      <section>
        <?php 
        etheme_option('custom_tab');
        ?>
      </section>
    </li>
  <?php 
    }
    ?>
</ul>

<div class="clear"></div>

<?php 
    $relateds = get_related_products($product_id, true, 220, 220);
    $rand = rand(10, 1000);
    if (count($relateds) > 0) {
        ?>
  <div class="product-slider related">
    <h4 class="slider-title"><?php 
        _e('Related products', ETHEME_DOMAIN);
        ?>
</h4>

    <div class="clear"></div>
    <div class="carousel">
      <div class="slider">
        <?php 
        $_i = 0;
        foreach ($relateds as $product) {