/**
  * Displays related products for the passed product id
  *
  * @param int $product_id.
  * @param string $relate_by Optional, whether to limit related to the same category, tags or both.
  * @param bool $echo. Optional, whether to echo or return the results
  * @param int $limit. Optional The number of products we want to retrieve.
  * @param bool $simple_list Optional, whether to show the related products based on the "list_view" setting or as a simple unordered list
  */
 function mp_related_products_sc($atts)
 {
     global $mp;
     $args = shortcode_atts($mp->defaults['related_products'], $atts);
     return mp_related_products($args);
 }
Beispiel #2
0
 function product_theme($content)
 {
     global $post;
     //don't filter outside of the loop
     if (!in_the_loop()) {
         return $content;
     }
     //add thumbnail
     if ($this->get_setting('show_img')) {
         $content = mp_product_image(false, 'single') . $content;
     }
     $content .= '<div class="mp_product_meta">';
     $content .= mp_product_price(false);
     $content .= mp_buy_button(false, 'single');
     $content .= '<span style="display:none" class="date updated">' . get_the_time('Y-m-d\\TG:i') . '</span>';
     $content .= '<span style="display:none" class="vcard author"><span class="fn">' . get_the_author_meta('display_name') . '</span></span>';
     $content .= '</div>';
     $content .= mp_category_list($post->ID, '<div class="mp_product_categories">' . __('Categorized in ', 'mp'), ', ', '</div>');
     $content .= mp_pinit_button($post->ID);
     $content .= mp_related_products($post->ID);
     return $content;
 }