Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Feature Request › Add vendors Website Address
- This topic has 13 replies, 4 voices, and was last updated 4 years, 7 months ago by tgl.
- AuthorPosts
- July 19, 2019 at 1:36 pm #73092sdel_nevoParticipant
Hi Guys
is it possible to add a vendors website to there store page? perhaps have this entered in the store details settings
would it also be possible to allow vendors to hide this as they can the e-mail address and phone number
Steve
- July 21, 2019 at 8:32 am #73253WCFM 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_action( 'wcfmmp_store_before_phone', function( $store_id ) { $site_url = get_user_meta( $store_id, 'wcfm_vendor_website', true ); if (strpos( $site_url, 'http') === false) { $site_url = "http://" . $site_url; } ?> <div class="store_info_parallal"><i class="wcfmfa fa-globe" aria-hidden="true"></i><span><a href="<?php echo $site_url; ?>"><?php echo $site_url; ?></a></span></div> <?php });
Thank You
- July 21, 2019 at 8:58 am #73260sdel_nevoParticipant
Hi guys
That’s great, will add this code and let you know how it goes
Steve
- July 21, 2019 at 9:14 am #73269WCFM ForumMember
Sure, please know me.
- July 21, 2019 at 9:53 am #73277sdel_nevoParticipant
Hi Guys
that’s great 🙂
I changed this line
add_action( ‘wcfmmp_store_after_phone’, function( $store_id ) {and its put the web address nicely between the phone number and the e-mail address
but is it possible to place a space between the last URL character and the icon for the e-mail address?
Steve
Attachments:
You must be logged in to view attached files. - July 21, 2019 at 9:55 am #73279sdel_nevoParticipant
also
if nothing is entered in the web address this is shown
HTTP:// on the store page, if this is clicked it goes to a webpage with an error
is it possible to only show this field if a value is entered?
Steve
- July 21, 2019 at 2:21 pm #73307WCFM ForumMember
HI,
add_action( ‘wcfmmp_store_after_phone’, function( $store_id ) {
Use this revised function for this –
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
- July 21, 2019 at 3:17 pm #73313sdel_nevoParticipant
Hi guys
That’s brilliant, will test when I’m in the office shortly and let you know how it goes
Steve
- July 22, 2019 at 5:08 am #73387WCFM ForumMember
Sure, please know me.
- July 22, 2019 at 9:18 am #73411sdel_nevoParticipant
Hi Guys
that code works brilliantly 🙂
Many Many thanks
Steve
- July 23, 2019 at 7:39 am #73540WCFM ForumMember
Glad to here 🙂
- April 22, 2020 at 3:16 pm #121737tglParticipant
Has the functionality for a website address been added to the plugin yet?
I tried this snippet on a brand new install tonight and I don’t see any added options in the store settings.
- April 24, 2020 at 10:17 pm #122623paul-8288Participant
HI @Sdel_nev, Steve.
There doesnt seem to be a way to contact other users on this forum, but any chance I can ping you an email about your Stripe implementation? Ive been struggling with a few aspects and see you have been through it on here. Maybe a private reply?Thanks
- April 25, 2020 at 1:25 am #122711tglParticipant
@paul-8288 I just put up a FB group for WC users, I will try to drop all the info in there I come across while building my marketplace with WC also:
https://www.facebook.com/groups/users.of.wcfm.marketplace/
Feel free to join in there, I see a lot of great potential in the plugin, but not much of a community of users talking yet, hopefully this can help out.
- AuthorPosts
- You must be logged in to reply to this topic.