Home › Forums › WC Vendors Pro Support › Contact Vendor Form (not link) on Single Product Page › Reply To: Contact Vendor Form (not link) on Single Product Page
February 24, 2017 at 2:08 am
#57426
Participant
Hi Anna, noted thanks. i was hoping for more of a fix, for just the form with buddypress though.
i managed to pull out some of the codes. although this is creating the form i need, it isnt sending a message to the vendor. are you able to further help me with this?
the codes i have are below.
<form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" enctype="multipart/form-data">
<?php
/**
* Fires before the display of message compose content.
*
* @since 1.1.0
*/
do_action( 'bp_before_messages_compose_content' ); ?>
<?php if ( is_user_logged_in() ) : ?>
<?php $wcv_store_id = get_the_author_meta('ID'); ?>
<?php $wcv_store_name = get_user_meta( $wcv_store_id, 'pv_shop_name', true); ?>
<?php echo '<br><a href="' . bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . get_the_author_meta('user_login') .'">' . $wcv_store_name . '</a>'; ?>
<label for="send-to-input"><?php _e("Send To $wcv_store_name", 'buddypress' ); ?></label>
<ul class="first acfb-holder">
<li>
<?php bp_message_get_recipient_tabs(); ?>
<input type="text" name="send-to-input" class="send-to-input" id="send-to-input" />
</li>
</ul>
<label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
<input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" />
<label for="message_content"><?php _e( 'Message', 'buddypress' ); ?></label>
<textarea name="content" id="message_content" rows="15" cols="20"><?php bp_messages_content_value(); ?></textarea>
<input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" />
<?php
/**
* Fires after the display of message compose content.
*
* @since 1.1.0
*/
do_action( 'bp_after_messages_compose_content' ); ?>
" name="send" id="send" />
<?php wp_nonce_field( 'messages_send_message' ); ?>
</form>
document.getElementById("send-to-input").focus();
<?php else :?>
<?php $wcv_my_account_url = get_permalink( get_option('woocommerce_myaccount_page_id')); ?>
<?php echo '<br><a href="' . $wcv_my_account_url . '">Login or Register to Contact Freelancer</a>'; ?>
<?php endif; ?>
</div>
-
This reply was modified 6 years, 1 month ago by
brandon.