Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _mp_products_html_list($post_array = array()) {
- global $mp;
- $html = '';
- $total = count($post_array);
- $count = 0;
- foreach ($post_array as $post) {
- $c = current(get_the_terms( $post->ID, 'product_category' ));
- if($c->slug != 'events') {
- $count++;
- //add last css class for styling grids
- if ($count == $total)
- $class = array('mp_product', 'last-product');
- else
- $class = 'mp_product';
- $html .= '<div ' . mp_product_class(false, $class, $post->ID) . '>';
- $html .= '<h3 class="mp_product_name"><a href="' . get_permalink($post->ID) . '">' . $post->post_title . '</a></h3>';
- $html .= '<div class="mp_product_content">';
- $product_content = mp_product_image(false, 'list', $post->ID);
- if ($mp->get_setting('show_excerpt'))
- $product_content .= $mp->product_excerpt($post->post_excerpt, $post->post_content, $post->ID);
- $html .= apply_filters('mp_product_list_content', $product_content, $post->ID);
- $html .= '</div>';
- $html .= '<div class="mp_product_meta">';
- //price
- $meta = mp_product_price(false, $post->ID);
- //button
- $meta .= mp_buy_button(false, 'list', $post->ID);
- $html .= apply_filters('mp_product_list_meta', $meta, $post->ID);
- $html .= '</div>';
- $html .= '</div>';
- }
- }
- return $html;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement