Home Forums WC Vendors Pro Support Contact Vendor Form (not link) on Single Product Page

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #56977
    brandon
    Participant

    Hi, the current codes found in Knowledgebase redirects the customer to contact vendor in a different page using buddypress private message.

    Are there any codes to have the form embedded instead of redirecting them to a different page?

    Thanks in advance!

    #57007
    Anna
    Member

    @brandonlar
    Hello,
    Not precisely, no..
    We do have integration with WooCommerce Product Enquiry plugin, which if set up as described here, will send an email to the vendor’s email address from the customer:

    -Enable the Product Enquiry plugin

    -go to: wp admin > WooCommerce > General

    -Change the Product Enquiry email field to BLANK (nothing)

    … and any mail sent via the product enquiry form on the product pages will be sent directly to the email of the vendor of that product.

    #57426
    brandon
    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>
    #57441
    brandon
    Participant

    Hi,

    i’ve managed to reduce the problem to the code being, the value and class isn’t represented since it’s not on the Buddypress page.

    <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(); ?>" />

    “bp_message_get_recipient_usernames()” does not work if i want to put this form elsewhere besides the buddypress page. is there some sort of hook i can use to grab the vendor shop username?

    #57507
    brandon
    Participant

    <input type="hidden" name="send_to_bp_usernames" id="send-to-bp-usernames" value="" class="">

    sorry for the multiple entries. just wanted to highlight that this was the ‘error’. the value and class doesnt show the vendor shop username.

    it was supposed to show something like <input type="hidden" name="send_to_usernames" id="send-to-usernames" value="brandon" class="brandon">

    #57514
    Anna
    Member

    Brandon..
    Admittedly, I am lost.
    1. if you share code, please use the button in the toolbar ^^ that says, CODE before and after your code sections..
    This will format the code correctly. 😉

    2. Please go to github, and (if you do not already have an account) make and account. Create a GIST. Save it. Then paste the URL of that gist in a reply here. That will show me the code you have in one neat place so I can see it.

    Although I am not certain I can help you, as this code is
    A. not ours
    B. This goes beyond WC Vendors support. We only give you a few tips on how to integrate buddypress with the vendors.. but beyond that– that’s not our playground.

    I can’t help much until I can see this code all together, so please create a GIST. Keeping your code in that format will also help you in the future when you are working with code.

    #57517
    brandon
    Participant

    Hi Anna, very sorry.

    i’ve done the github thing and the link is here.

    https://gist.github.com/brandonlar/ae7dced864dba32d6a074ab1a17b88ca

    I understand. any help you can give me would mean a lot. my problem with the code now is that the message doesnt send through, because the value and class for the ‘send message button’ is empty.

    i’ve been trying to figure this thing out for more than a week :s really appreciate any help you can give.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.