Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Website in social area for vendors
- This topic has 6 replies, 3 voices, and was last updated 5 years ago by Ivan Black.
- AuthorPosts
- November 23, 2019 at 5:11 pm #93628xximinabandxxParticipant
Can we add a link for vendors to list their website in the social area of their profile?
- November 26, 2019 at 3:06 pm #94034WCFM ForumMember
Hi,
Please add this code to your site for the purpose-
add_action( 'end_wcfm_vendor_settings', function( $vendor_id ) { global $WCFM; $wcfm_vendor_website = get_user_meta( $vendor_id, 'wcfm_vendor_website', true ); ?> <!-- collapsible --> <div class="page_collapsible" id="wcfm_settings_form_additional_head"> <label class="fa fa-certificate"></label> <?php _e('Additional Info', 'wc-multivendor-marketplace'); ?><span></span> </div> <div class="wcfm-container"> <div id="wcfm_settings_form_additional_expander" class="wcfm-content"> <h2><?php _e('Additional Setting', 'wc-multivendor-marketplace'); ?></h2> <div class="wcfm_clearfix"></div> <?php $WCFM->wcfm_fields->wcfm_generate_form_field( array( "wcfm_vendor_website" => array( 'label' => __( 'Website', 'wc-multivendor-marketplace'), 'name' => 'wcfm_vendor_website', 'type' => 'text', 'class' => 'wcfm-text wcfm_ele', 'label_class' => 'wcfm_title wcfm_ele', 'value' => $wcfm_vendor_website ), ) ); ?> </div> </div> <!-- end collapsible --> <?php }, 50, 1 ); add_action( 'wcfm_vendor_settings_update', function( $vendor_id, $wcfm_settings_form ) { global $WCFM, $_POST; if( isset( $wcfm_settings_form['wcfm_vendor_website'] ) ) { update_user_meta( $vendor_id, 'wcfm_vendor_website', $wcfm_settings_form['wcfm_vendor_website'] ); } }, 50, 2 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- November 26, 2019 at 3:49 pm #94049xximinabandxxParticipantThis reply has been marked as private.
- December 7, 2019 at 8:47 pm #96522WCFM ForumMember
Well, it added a new setting tab “Additional Info” and added this field there.
Use this short code to show this –
[wcfm_store_info data="wcfm_vendor_website"]
Thank You
- December 11, 2019 at 8:22 pm #97049Ivan BlackParticipant
Hello,
1) How can I automatically output the website on product pages alongside the vendors telephone and email with an icon. That is in the store info section. Using the shortcode [wcfm_store_info data=”store_website”] means the link is not clickable.
2) Instead of showing this in a separate collapsible section called “additional info”, how can it be moved to vendors >> /store-manager/settings/ under the ‘store phone’ field?
3) Using this code adds the website field for vendors >> /store-manager/settings/ but not admin edit vendors screen. How can it be added for admin also to see / edit?
Thank you
- December 12, 2019 at 5:32 pm #97244WCFM ForumMember
HI,
1) How can I automatically output the website on product pages alongside the vendors telephone and email with an icon. That is in the store info section. Using the shortcode [wcfm_store_info data=”store_website”] means the link is not clickable.
– Add this code to your site for the purpose-
add_action( 'wcfmmp_store_after_phone', function( $store_id ) { $site_url = get_user_meta( $store_id, 'wcfm_vendor_website', true ); if( $site_url ) { $site_url_href = $site_url; if (strpos( $site_url_href, 'http') === false) { $site_url_href = "http://" . $site_url_href; } ?> <div class="store_info_parallal" style="margin-right: 10px;"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="<?php echo $site_url_href; ?>"><?php echo $site_url; ?></a></span></div> <?php } });
Thank You
- December 20, 2019 at 5:58 pm #98216Ivan BlackParticipant
Hello,
1) The previous code outputs the website on the vendor store page but NOT product pages. I would like to display the website on product pages in the Store tab alongside the email and telephone.
2) For vendors, instead of showing the website field in a separate collapsible section called “additional info”, how can it be moved to vendors >> /store-manager/settings/ under the ‘store phone’ field? Having it in a separate tab is completely unnecessary and confusing for vendors.
Thank you.
- AuthorPosts
- The topic ‘Website in social area for vendors’ is closed to new replies.