/** * * * @param unknown $name * @param unknown $_product * * @return unknown */ function show_vendor_in_email($name, $_product) { $product = get_post($_product->id); $sold_by = PV_Vendors::is_vendor($product->post_author) ? sprintf('<a href="%s" target="_TOP">%s</a>', PV_Vendors::get_vendor_shop_page($product->post_author), PV_Vendors::get_vendor_shop_name($product->post_author)) : get_bloginfo('name'); $name .= '<small><br />' . __('Sold by', 'wc_product_vendor') . ': ' . $sold_by . '</small><br />'; return $name; }
public function filter_comment($commentdata, $order) { $user_id = get_current_user_id(); $commentdata['user_id'] = $user_id; $commentdata['comment_author'] = PV_Vendors::get_vendor_shop_name($user_id); $commentdata['comment_author_url'] = PV_Vendors::get_vendor_shop_page($user_id); $commentdata['comment_author_email'] = wp_get_current_user()->user_email; return $commentdata; }
/** * [pv_recent_vendor_sales] shortcode * * @param array $atts * * @return unknown */ public function display_vendor_settings($atts) { global $woocommerce; if (!$this->can_view_vendor_page()) { return false; } extract(shortcode_atts(array('user_id' => get_current_user_id(), 'paypal_address' => true, 'shop_description' => true), $atts)); $description = get_user_meta($user_id, 'pv_shop_description', true); $seller_info = get_user_meta($user_id, 'pv_seller_info', true); $has_html = get_user_meta($user_id, 'pv_shop_html_enabled', true); $shop_page = PV_Vendors::get_vendor_shop_page(wp_get_current_user()->user_login); $global_html = Product_Vendor::$pv_options->get_option('shop_html_enabled'); ob_start(); woocommerce_get_template('settings.php', array('description' => $description, 'global_html' => $global_html, 'has_html' => $has_html, 'paypal_address' => $paypal_address, 'seller_info' => $seller_info, 'shop_description' => $shop_description, 'shop_page' => $shop_page, 'user_id' => $user_id), 'wc-product-vendor/dashboard/settings/', pv_plugin_dir . 'views/dashboard/settings/'); return ob_get_clean(); }
/** * */ public function sold_by_meta() { $author_id = get_the_author_meta('ID'); $sold_by = PV_Vendors::is_vendor($author_id) ? sprintf('<a href="%s" target="_TOP">%s</a>', PV_Vendors::get_vendor_shop_page($author_id), PV_Vendors::get_vendor_shop_name($author_id)) : get_bloginfo('name'); echo __('Sold by', 'wc_product_vendor') . ': ' . $sold_by . '<br/>'; }