Home Forums WC Vendors Pro Support Prevent registration if no paypal address entered

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 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #38978
    Nofski
    Participant

    Hi Ben, Jamie & ANNA! 🙂 (congrats on your exciting new life)

    Is there anyway you can prevent a user from registering if they “don’t add” their paypal address. I have had to resign myself to the fact that I can only get the functionality I want if paypal is the only gateway, and therefore am requesting it as a must in order for anyone to use the site.

    Even though I am manually approving applications (if I ever go live! read 1 year plus developing here). I don’t necessarily want the admin of having to reply to incorrectly filled out registrations. Thats another admin step that I want to avoid.

    I am currently using the the code provided by one on the users to prevent checkout if somebody forgets but that is only good once up and running and as I, Admin, am the primary user on the site, the code does not factor in admin as vendor and disables checkout on any of my products.

    I also know there is a make fields required code on the knowledge base, but as I have not even been able to make that work on the product page yet, I doub’t im going to be able to suss it to work on the registration page.

    as always
    thanks in advance

    #38990
    Obsi Dian
    Participant

    Some sort of warning for vendors would be useful – like a big annoying bar across the top of the page 🙂

    We launched our site the other day and I create the vendor accounts but leave them to fill out their details (I manually approve all vendors applications, and we’d moved from a different host, so I assumed they would be savvy enough to cope with entering the basics). Well, you know what they say about assuming 😛 We had a vendor who decided to upload products first and was going to fill out all that less necessary stuff like payment and contact info later, and a customer trying to buy those products *sigh*.

    #39067
    Anna
    Member

    @clothpadshop @nofski
    Currently I can help you prevent vendors from being able to ADD PRODUCTS if they have not entered their paypal email address. This will post a notification if they go to add a product, and guide them to the pro dashboard/settings so they can enter their payment information.

    I will try to make a similar piece for the register.. but that’ll take me a bit of work.

    ……………………………………………..
    Try this, test it, and let me know if it works for you:

    1. First, make sure you’ve moved the product-edit.php template to your child theme (wp-content/themes/YOUR-CHILD-THEME/wc-vendors/dashboard/product-edit.php).

    2. Edit the product-edit.php file as follows:

    go to approx. line 24.

    Directly BEFORE this:
    /**
    * Ok, You can edit the template below but be careful!
    */
    ?>

    Paste this code:

    $value = get_user_meta( get_current_user_id(), 'pv_paypal', true );
    
    if ( !empty( $value ) ) {

    Now, scroll to the bottom of the page, approx. line 210, AFTER: paste the following code:

    <?php
    } else {
    
    echo '  <strong>WAIT!</strong>   Before you can add products, you need to enter your paypal email address, so you can receive the funds from your sales. Please <a href="/pro-dashboard/settings/"> VISIT YOUR STORE DASHBOARD SETTINGS </a> and click the PAYMENTS tab.';
    }
    ?>

    Try it! 🙂

    You’ll need to add YOUR appropriate dashboard link for your pro dashboard, and you will likely want to customize your notification message text and add your appropriate pro dashboard settings link.

    *If you are using the onesocial theme / social marketplace by buddyboss, your path to put the file in your child theme to edit will look like: wp-content/themes/YOUR-CHILD-THEME/bb-marketplace/wc-vendors/dashboard/product-edit.php.

    #39163
    Obsi Dian
    Participant

    Awesome!

    I wasn’t sure where to paste the second part, as my page doesn’t have line numbers marked, but I pasted it at the very bottom of the page (after the close of the </form>) since that seemed to be where it would go.

    It stopped the vendor being able to create a product on the front end – as the product editor doesn’t show up at all – which is great! (they can still enter them on the backend though) – but it didn’t bring up the message to go fill out their paypal details.

    I tried in my store theme (artificer) and in the default storefront theme.

    #39171
    Nofski
    Participant

    yes I echo obsi’s statement of delight. no need to work out how to do in the registration page anna. the end result has been achieved.

    #39220
    Anna
    Member

    @clothpadshop

    I don’t know why it is not showing up. Maybe for your theme you need to add a

    /

    or a
    Try something like this:

    <?php
    } else {
    
    echo '<p> WAIT!    Before you can add products, you need to enter your paypal email address, so you can receive the funds from your sales. Please <a href="/pro-dashboard/settings/"> VISIT YOUR STORE DASHBOARD SETTINGS </a> and click the PAYMENTS tab.</p>';
    }
    ?>

    or

    <?php
    } else {
    
    echo '<span class="font-size:18px;"> WAIT!    Before you can add products, you need to enter your paypal email address, so you can receive the funds from your sales. Please <a href="/pro-dashboard/settings/"> VISIT YOUR STORE DASHBOARD SETTINGS </a> and click the PAYMENTS tab.</span>';
    }
    ?>

    #39232
    Obsi Dian
    Participant

    Got it now – thanks so much!

    #41063
    Wesley Li
    Participant

    Hi, I’m using social marketplace by buddyboss and I followed your steps.

    And I got the error below when trying add the product:

    Parse error: syntax error, unexpected ‘}’, expecting end of file in /home1/e4f6g2v5/public_html/nightmarketonline.ca/wp-content/themes/onesocial-child/bb-marketplace/wc-vendors/dashboard/product-edit.php on line 212

    I attached my product-edit.php for your reference.

    Thank you.

    #41065
    Wesley Li
    Participant

    Oh, my bad.

    I added the

    $value = get_user_meta( get_current_user_id(), 'pv_paypal', true );
    if ( !empty( $value ) ) {

    After the

    /**
    * Ok, You can edit the template below but be careful!
    */
    ?>

    I put them back before it, now is working.

    Thank you.

    #41160
    Anna
    Member

    Wesley,
    Glad you worked it out. This is a very helpful piece of code so that vendors do not list products without having their payment details entered.. 🙂

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