Home Forums WC Vendors Pro Support Require Stripe and PayPal

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 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #59603
    Sara
    Participant

    Hello, I am trying to have my vendors be forced to sign up for both Stripe and PayPal to sell on my site. I was able to achieve Stripe by following the coding in the KB,
    https://www.wcvendors.com/kb/prevent-product-listing-vendor-no-stripe-account-connected-stripe-gateway-commissions/
    but I was also trying to put the PayPal required code in there too and keep getting errors.

    Ideally I would like the bottom to read “Before you can add products, you must connect to STRIPE and PAYPAL…” and have that message appear until both requirements were done, but, two different lines/messages would be fine too if that can’t be done.

    I am just struggling with how or where to put
    $value = get_user_meta( get_current_user_id(), ‘pv_paypal’, true );
    if ( !empty( $value ) ) {

    and

    <?php
    } else {

    echo ‘ WAIT! Before you can add products, you need to enter your paypal email address, so you can receive the funds from your sales. Please VISIT YOUR STORE DASHBOARD SETTINGS and click the PAYMENTS tab.’;
    }
    ?>

    if I already have coding requiring Stripe. Is it possible you would know exactly where those two pieces of code would need to go in relation to the modified file that requires Stripe?

    I will post the code in the next comment that is working for Stripe.

    Thank you for all of your amazing support.

    #59604
    Sara
    Participant

    <?php
    /**
    * The template for displaying the Product edit form
    *
    * Override this template by copying it to yourtheme/wc-vendors/dashboard/
    *
    * @package WCVendors_Pro
    * @version 1.3.2
    */
    /**
    * DO NOT EDIT ANY OF THE LINES BELOW UNLESS YOU KNOW WHAT YOU’RE DOING
    *
    */
    $title = ( is_numeric( $object_id ) ) ? __(‘Save Changes’, ‘wcvendors-pro’) : __(‘Add Product’, ‘wcvendors-pro’);
    $product = ( is_numeric( $object_id ) ) ? wc_get_product( $object_id ) : null;
    // Get basic information for the product
    $product_title = ( isset($product) && null !== $product ) ? $product->post->post_title : ”;
    $product_description = ( isset($product) && null !== $product ) ? $product->post->post_content : ”;
    $product_short_description = ( isset($product) && null !== $product ) ? $product->post->post_excerpt : ”;
    $post_status = ( isset($product) && null !== $product ) ? $product->post->post_status : ”;
    /**
    * Ok, You can edit the template below but be careful!
    */
    $access_token = get_user_meta( get_current_user_id(), ‘_stripe_connect_access_key’, true );

    if ( !empty( $access_token ) ) {

    ?>
    <h2><?php echo $title; ?></h2>

    <!– Product Edit Form –>
    <form method=”post” action=”” id=”wcv-product-edit” class=”wcv-form wcv-formvalidator”>

    <!– Basic Product Details –>

    </div>

    <hr />

    </div>

    </div>

    <?php do_action( ‘wcv_after_general_tab’, $object_id ); ?>

    <?php do_action( ‘wcv_before_inventory_tab’, $object_id ); ?>

    <!– Inventory –>

    <?php WCVendors_Pro_Product_Form::stock_status( $object_id ); ?>

    <?php do_action( ‘wcv_product_options_sold_individually’ ); ?>

    <?php do_action( ‘wcv_product_options_inventory_product_data’ ); ?>

    </div>

    <?php do_action( ‘wcv_after_inventory_tab’, $object_id ); ?>

    <?php do_action( ‘wcv_before_shipping_tab’, $object_id ); ?>

    <!– Shipping –>

    </div>

    <?php do_action( ‘wcv_after_shipping_tab’, $object_id ); ?>

    <?php do_action( ‘wcv_before_linked_tab’, $object_id ); ?>

    <!– Upsells and grouping –>

    </div>

    <?php do_action( ‘wcv_after_linked_tab’, $object_id ); ?>

    <!– Attributes –>

    <?php do_action( ‘wcv_before_attributes_tab’, $object_id ); ?>

    <?php do_action( ‘wcv_after_attributes_tab’, $object_id ); ?>

    <!– Variations –>

    <?php do_action( ‘wcv_before_variations_tab’, $object_id ); ?>

    <?php do_action( ‘wcv_after_variations_tab’, $object_id ); ?>

    <?php WCVendors_Pro_Product_Form::form_data( $object_id, $post_status ); ?>
    <?php WCVendors_Pro_Product_Form::save_button( $title ); ?>
    <?php WCVendors_Pro_Product_Form::draft_button( __(‘Save Draft’,’wcvendors-pro’) ); ?>

    </div>
    </div>
    </form>
    <?php
    } else {

    echo ‘ <p>WAIT! Before you can add products, you must connect to STRIPE, so you can receive the funds from your sales. To connect to Stripe, VISIT YOUR STORE DASHBOARD SETTINGS and click the PAYMENTS tab.</p>’;
    }
    ?>

    #59606
    Anna
    Member

    Sara,
    I can’t exactly test this– since I only use Stripe on my live site and my local site will not be able to use Stripe connect. 😉 BUT– this *should* work.
    https://gist.github.com/fervous/fd4fac31eaea482679b83665c28c3a4b

    #59607
    Anna
    Member

    ^^ That code would go in your modified product-edit.php template.

    Find the template here: wp-content/plugins/wcvendors-pro/templates/dashboard/product-edit.php
    and move it here: wp-content/themes/yourtheme-or-childtheme/wc-vendors/dashboard/product-edit.php

    Add/change the code.

    #59608
    Sara
    Participant

    Anna, thank you so much!!! This worked, and you are amazing!!! Thank you!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.
This website uses cookies to ensure you get the best experience on our website.