Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Checkbox to accept Vendor Policies during Checkout
- This topic has 2 replies, 3 voices, and was last updated 4 years, 6 months ago by stzi.
- AuthorPosts
- April 1, 2020 at 2:42 am #114391DeinDorflebenParticipant
Hello everybody,
I really enjoy the WCFM Marketplace but concerning the German Law I have the following issue:
It’s necessary that the user accepts the Terms & conditions (T&C) of the Vendor within the checkout process.
With the PlugIn Woocommerce Germanized it is possible to create a checkbox with my (!) T&C but NOT with the Vendor T&C.Could you give me a hint how I can solve this issue?
Thanks in Advance for your support,
BR Florian - April 4, 2020 at 12:44 pm #115249WCFM ForumMember
Hi,
Please add this code to your site for the purpose-
add_action( 'woocommerce_checkout_order_review', function() { if( function_exists( 'is_checkout' ) && is_checkout() ) { $cart_vendors = array(); foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $cart_product_id = $cart_item['product_id']; $cart_product = get_post( $cart_product_id ); $cart_product_author = $cart_product->post_author; if( function_exists( 'wcfm_is_vendor' ) && wcfm_is_vendor( $cart_product_author ) ) $cart_vendors[$cart_product_author] = $cart_product_author; } if( !empty( $cart_vendors ) ) { echo '<div class="wc-gzd-checkbox-placeholder wc-gzd-checkbox-placeholder-legal" data-checkbox="vendor-terms"> <p class="legal form-row checkbox-legal validate-required" data-checkbox="vendor-terms"> <label for="legal" class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> <span class="woocommerce-gzd-legal-checkbox-text">Allgemeinen Geschäftsbedingungen von '; foreach( $cart_vendors as $cart_vendor ) { $store_user = wcfmmp_get_store( $cart_vendor ); echo '<a target="_blank" href="' .$store_user->get_policies_url() . '/#tab_links_area">' . wcfm_get_vendor_store_name( $cart_vendor ) . '</a>'; } echo ' einverstanden.<span></label></p></div>'; } } }, 11 );
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/Thank You
- April 27, 2020 at 12:04 am #123408stziParticipant
Hi, could you please explain how to make this checkbox mandatory? Thanks
- AuthorPosts
- You must be logged in to reply to this topic.