Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. function _mp_products_html_list($post_array = array()) {
  2.     global $mp;
  3.     $html = '';
  4.     $total = count($post_array);
  5.     $count = 0;
  6.     foreach ($post_array as $post) {
  7.     $c = current(get_the_terms( $post->ID, 'product_category' ));
  8.         if($c->slug != 'events') {
  9.         $count++;
  10.  
  11.         //add last css class for styling grids
  12.         if ($count == $total)
  13.             $class = array('mp_product', 'last-product');
  14.         else
  15.             $class = 'mp_product';
  16.  
  17.         $html .= '<div ' . mp_product_class(false, $class, $post->ID) . '>';
  18.         $html .= '<h3 class="mp_product_name"><a href="' . get_permalink($post->ID) . '">' . $post->post_title . '</a></h3>';
  19.         $html .= '<div class="mp_product_content">';
  20.         $product_content = mp_product_image(false, 'list', $post->ID);
  21.         if ($mp->get_setting('show_excerpt'))
  22.             $product_content .= $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID);
  23.         $html .= apply_filters('mp_product_list_content', $product_content, $post->ID);
  24.         $html .= '</div>';
  25.  
  26.         $html .= '<div class="mp_product_meta">';
  27.         //price
  28.         $meta = mp_product_price(false, $post->ID);
  29.         //button
  30.         $meta .= mp_buy_button(false, 'list', $post->ID);
  31.         $html .= apply_filters('mp_product_list_meta', $meta, $post->ID);
  32.         $html .= '</div>';
  33.  
  34.         $html .= '</div>';
  35.     }
  36.     }
  37.  
  38.     return $html;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement