function seller_all_product() { $str = ''; if (isset($_REQUEST['str'])) { $str = $_REQUEST['str']; } if (isset($_GET['sid'])) { $sellerid = $_GET['sid']; } else { $sellerid = ''; } $wpmp_obj11 = new MP_Form_Handler(); ?> <style type="text/css"> header h1 { display:none; } aside { display:none; } #main { width:100%; } </style> <div id="productlist"> <h1 class="seller-collection"><?php echo _e('Collection'); ?> </h1> <div id="seller_product_list_left"> <div class="Advertisement" style="border-style:none;"> <?php /*$shop_logo=MP_Form_Handler::get_user_avatar($sellerid,'company_logo'); */ $shop_logo = $wpmp_obj11->get_user_avatar($sellerid, 'company_logo'); if (isset($shop_logo[0]->meta_value)) { echo '<img src="' . content_url() . '/uploads/' . $shop_logo[0]->meta_value . '">'; } else { echo '<img src="' . content_url() . '/plugins/marketplace/assets/images/shop-logo.png" />'; } ?> </div> <div class="Advertisement" style="display:none;"> <div id='mp_left_details_first'><?php echo _e('Seller Category List'); ?> </div> <?php echo product_categories(''); $seller_id = $_GET['sid']; ?> </div> <div class="Advertisement"> <div id='mp_left_details_first'><?php echo _e('View Collection'); ?> </div> <div class="mp_left_details"> <a href='#'><?php echo _e('View Collection'); ?> </a> </div> <?php $varsid = get_query_var('sid'); if (empty($varsid)) { $varsid = $_GET['sid']; } ?> <?php if (strchr(get_permalink(), '?')) { $icon = '&'; } else { $icon = '?'; } ?> <div class="mp_left_details"><a href='<?php echo get_permalink() . $icon; ?> page=Spreview&sid=<?php echo $varsid; ?> ' ><?php echo _e('View Profile'); ?> </a></div> </div> </div> <?php if ($seller_id) { ?> <div id="seller_product_list_right"> <div id='wk_banner'> <?php $banner = $wpmp_obj11->get_user_avatar($seller_id, 'shop_banner'); if (!isset($banner[0]->meta_value)) { ?> <img src="<?php echo content_url() . '/plugins/marketplace/assets/images/woocommerce-marketplace-banner.png'; ?> " /> <?php } else { ?> <img src="<?php echo content_url() . '/uploads/' . $banner[0]->meta_value; ?> " class="collection-banner"/> <?php } ?> <div class='seller_grid'><?php echo _e('Sort By'); ?> <select class='mp_value_asc'> <?php if ($str == 'price_l') { ?> <option selected="selected" value="price_l" > <?php echo _e('Price'); ?> (<?php echo _e('Low To High'); ?> ) </option> <?php } else { ?> <option value="price_l" > <?php echo _e('Price'); ?> (<?php echo _e('Low To High'); ?> ) </option> <?php } if ($str == 'price_h') { ?> <option selected="selected" value="price_h"> <?php echo _e('Price'); ?> (<?php echo _e('High To Low'); ?> ) </option> <?php } else { ?> <option value="price_h"> <?php echo _e('Price'); ?> (<?php echo _e('High To Low'); ?> ) </option> <?php } if ($str == 'productname_l') { ?> <option selected="selected" value="productname_l" > <?php echo _e('Name'); ?> (<?php echo _e('Asc To Desc'); ?> ) </option> <?php } else { ?> <option value="productname_l" > <?php echo _e('NAME'); ?> (<?php echo _e('Asc To Desc'); ?> ) </option> <?php } if ($str == 'productname_h') { ?> <option selected="selected" value="productname_h" > <?php echo _e('Name'); ?> (<?php echo _e('Desc To Asc'); ?> ) </option> <?php } else { ?> <option value="productname_h" > <?php echo _e('Name'); ?> (<?php echo _e('Desc To Asc'); ?> ) </option> <?php } ?> </select> </div> </div> <div class="box-content"> <?php /*$products = MP_Form_Handler::produt_by_seller_ID($seller_id,$str); $banner=MP_Form_Handler::get_user_avatar($seller_id,'shop_banner');*/ $products = $wpmp_obj11->produt_by_seller_ID($seller_id, $str); $banner = $wpmp_obj11->get_user_avatar($seller_id, 'shop_banner'); foreach ($products as $product) { $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); /*$product_image=MP_Form_Handler::get_product_image($product->ID,'_thumbnail_id');*/ $product_image = $wpmp_obj11->get_product_image($product->ID, '_thumbnail_id'); $product_object = get_product($product->ID); /*echo "<pre>"; print_r($product_object->product_type); echo "</pre>";*/ /* if($product_object->post_status=='publish'){ } */ $link = get_permalink($product->ID); ?> <div class="seller_product_row"> <li> <a class="product_img_link" title="<?php echo $product->post_title; ?> " href="<?php echo $link; ?> "> <div class="wk-slider-product-img"><?php if ($product_image != '') { ?> <img class="product_image" alt="<?php echo $product->post_title; ?> " src="<?php echo content_url() . '/uploads/' . $product_image; ?> "> <?php } else { ?> <img class="product_image" alt="<?php echo $product->post_title; ?> " src="<?php echo plugins_url('marketplace/assets/images/placeholder.png'); ?> "> <?php } ?> </div> <div class="wk-slider-product-info"> <h3><div style="margin-bottom:5px;"><?php echo $product->post_title; ?> </div></h3> <!-- <div style="font-weight:bold;"><?php /*echo woocommerce_price($product->regular_price);*/ ?> </div> --> <!-- <span><?php /*echo 'product_type= '.$product_object->product_type;*/ ?> </span><br> --> <?php if ($product_object->is_type('simple')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('variable')) { ?> <span class="price"> <span class="amount"><?php echo woocommerce_price($product_object->min_variation_price); ?> </span> – <span class="amount"><?php echo woocommerce_price($product_object->max_variation_price); ?> </span> </span> <?php } else { if ($product_object->is_type('external')) { ?> <span class="amount"><?php echo woocommerce_price($product_object->price); ?> </span> <?php } else { if ($product_object->is_type('grouped')) { ?> <span class="amount"><?php echo ''; ?> </span> <?php } } } } ?> </div> </a> <!-- <div style="text-align:center;"> --> <!-- <form class="cart" enctype="multipart/form-data" method="post"> <input type="hidden" value="<?php /*echo $product->ID;*/ ?> " name="add-to-cart"> <button class="single_add_to_cart_button button alt" type="submit">Add to cart</button> </form> --> <!-- </div> --> </li> </div> <?php } ?> </div> </div> <?php } }