'; //$rep = ByDesign_Replication::get_replicated_user(); if( ByDesign_Replication::is_default_rep() ) { echo '

' . __('Representative') . '

'; woocommerce_form_field( 'customer_rep', array( 'type' => 'text', 'class' => array('customer-rep form-row-wide'), 'label' => __('Representative ID or Name'), 'description' => __('If you were referred by someone, enter their Rep ID or full name here.'), 'placeholder' => __('Representative ID or Name'), ), $checkout->get_value( 'customer_rep' )); } echo '

' . __('Terms and Conditions') . '

'; //$terms = "

Click here if you agree to the Terms and Conditions as presented here. You cannot continue without agreeing to the Terms and Conditions.

"; $terms = "
"; $terms .= "

All payments must be official and cleared before shipment is made.

"; $terms .= "

Our Guarantee: Please know that if you are not satisfied with your Flint River Ranch product, you can return your purchase within 30 days for a full product refund. Flint River Ranch must be contacted within those 30 days to be informed of your intention to return these products in order to qualify for a full product refund. Product must be shipped at customer’s expense, postage paid, to the Flint River Ranch facility assigned to receive your return by the Call Center. Please contact FRR at 800/354-6858 during our work hours or email us at orders@frrco.com for appropriate instructions and a return authorization code (RAC).

"; $terms .= "

Products being returned must be resealed if opened, properly padded & packed. Please have the RAC clearly marked on the outside of the package below your return address. Please include this RAC on a memo inside summarizing the reason for return; if you have been emailed instructions for your return…a copy of the email is sufficient, please insure that your Flint River Ranch number is on all documentation.

"; $terms .= "

Orders received outside of this process will not fall under this stated guarantee and may have additional Shipping & Handling charges assessed to the refund.

"; $terms .= "
"; echo $terms; $checked = $checkout->get_value( 'customer-terms' ) ? $checkout->get_value( 'customer-terms' ) : 1; woocommerce_form_field( 'customer-terms', array( 'type' => 'checkbox', 'class' => array('input-checkbox customer-terms'), 'label' => __('I agree to the Terms and Conditions.'), //'description' => $terms, 'required' => true, ), 0 ); echo ''; } add_action( 'woocommerce_after_order_notes', 'flint_checkout_fields' ); add_action('woocommerce_checkout_process', 'flint_checkout_validate'); function flint_checkout_validate() { // Check if set, if its not set add an error. if ( ! $_POST['customer-terms'] ) wc_add_notice( __( 'You must agree to the Terms and Conditions.' ), 'error' ); } function flint_checkout_update( $order_id, $posted=null ) { $order = new WC_Order( $order_id ); if( ByDesign_Replication::is_default_rep() ) { if ( ! empty( $_POST['customer_rep'] ) ) { update_post_meta( $order_id, 'customer_rep', sanitize_text_field( $_POST['customer_rep'] ) ); $order->add_order_note( sprintf( 'Customer Rep: %s', $_POST['customer_rep'] ) ); } } else { $rep = ByDesign_Replication::get_replicated_user(); if($rep) { update_post_meta( $order_id, 'customer_rep', sanitize_text_field( $rep->RepDID ) ); $order->add_order_note( sprintf( 'Customer Rep: %s', $rep->RepDID ) ); } } } add_action( 'woocommerce_checkout_order_processed', 'flint_checkout_update' ); function flint_checkout_values($order){ echo '

'.__('Customer Rep').': ' . get_post_meta( $order->id, 'customer_rep', true ) . '

'; echo '

'.__('ByDesign Order ID').': ' . get_post_meta( $order->id, 'bydesign_order_id', true ) . '

'; } add_action( 'woocommerce_admin_order_data_after_billing_address', 'flint_checkout_values', 10, 1 ); function flint_lostpassword_url( $url, $endpoint, $value, $permalink ) { if( $endpoint == 'lost-password') { return "https://extranet.securefreedom.com/FlintRiverRanch/Shopping/ShoppingCart_RequestPassword.asp"; } return $url; } add_filter( 'woocommerce_get_endpoint_url', 'flint_lostpassword_url', 10, 4 ); function flint_checkout_bydesign_invoice_notes( $order, $notes ) { if( ByDesign_Replication::is_default_rep() ) { if ( ! empty( $_POST['customer_rep'] ) ) { $notes .= " -- ByDesign Rep: " . $_POST['customer_rep']; } } else { $rep = ByDesign_Replication::get_replicated_user(); if($rep) { $notes .= " -- ByDesign Rep: " . $rep->RepDID; } } return $notes; } add_filter( 'woocommerce_gateway_bydesign_invoice_notes', 'flint_checkout_bydesign_invoice_notes', 10, 2); */