Checkbox to accept Vendor Policies during Checkout

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

  • This topic has 2 replies, 3 voices, and was last updated 2 years ago by stzi.
Viewing 2 reply threads
  • Author
    Posts
    • #114391
      DeinDorfleben
      Participant

      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

    • #115249
      WCFM Forum
      Keymaster

      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

    • #123408
      stzi
      Participant

      Hi, could you please explain how to make this checkbox mandatory? Thanks

Viewing 2 reply threads
  • You must be logged in to reply to this topic.