/**
* When a formidable form submitted, add form's connected product to cart.
*/
add_action('frm_after_create_entry', 'ff_take_user_to_wc_checkout_for_payment', 20, 2);
function ff_take_user_to_wc_checkout_for_payment($entry_id, $form_id) {
$linked_products = get_posts([
'post_type' => 'product',
'post_status' => 'publish',
'numberposts' => 1,
'meta_key' => '_attached_formidable_form',
'meta_value' => $form_id,
'cache_results' => false,
]);
if (empty($linked_products)) {
return;
}
$product_id = $linked_products[0]->ID;
if (!function_exists('WC') || !WC()->session) {
return;
}
if (method_exists(WC()->session, 'set_customer_session_cookie')) {
WC()->session->set_customer_session_cookie(true);
}
WC()->cart->empty_cart();
$entry = FrmEntry::getOne($entry_id, true);
$form_data = $entry->metas;
$addon_total = 0;
foreach ($form_data as $value) {
if (is_string($value) && strpos(trim($value), '$') === 0) {
$price = floatval(str_replace(['$', ','], '', $value));
$addon_total += $price;
}
}
WC()->session->set('addon_total', $addon_total);
WC()->cart->add_to_cart($product_id, 1, 0, [], ['addon_total' => $addon_total]);
if (empty($_POST['frm_ajax'])) {
wp_safe_redirect(wc_get_checkout_url());
exit;
}
}
/**
* When an item is added to the cart, remove other products.
*/
add_filter( 'woocommerce_add_to_cart_validation', 'ff_keep_only_one_product_in_the_cart', 10, 3 );
function ff_keep_only_one_product_in_the_cart( $valid, $product_id, $quantity ) {
if( ! empty ( WC()->cart->get_cart() ) && $valid ) {
WC()->cart->empty_cart();
}
return $valid;
}
/**
* Disable add to cart confirmation message.
*/
add_filter( 'wc_add_to_cart_message_html', '__return_false' );
/**
* Redirect user to checkout page after adding a product to cart.
*/
add_filter ('add_to_cart_redirect', 'ff_redirect_to_checkout');
function ff_redirect_to_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
/**
* Calculate formidable add-on prices and add them to the total price in WC checkout.
*/
add_action('woocommerce_before_calculate_totals', 'ff_apply_addon_total_to_cart_price', 10, 1);
function ff_apply_addon_total_to_cart_price($cart) {
if (is_admin() && !defined('DOING_AJAX')) {
return;
}
foreach ($cart->get_cart() as $cart_item) {
if (!empty($cart_item['addon_total'])) {
$base_price = $cart_item['data']->get_price();
$addon_price = floatval($cart_item['addon_total']);
$cart_item['data']->set_price($base_price + $addon_price);
}
}
}
/**
* Use different Authorize.net accounts in checkout.
*/
add_filter( 'option_woocommerce_authorizeaim_settings', function( $woocommerce_authorizeaim_settings ) {
global $woocommerce;
if ( function_exists( 'is_checkout' ) && function_exists( 'get_field' ) && is_checkout() ) {
foreach ( $woocommerce->cart->get_cart() as $cart_item ) {
$product_id = $cart_item['product_id'];
$api_login_id = get_post_meta( $product_id, 'api_login_id', true );
$transaction_key = get_post_meta( $product_id, 'transaction_key', true );
if ( !empty( $api_login_id ) && !empty( $transaction_key ) ) {
$woocommerce_authorizeaim_settings['login_id'] = $api_login_id;
$woocommerce_authorizeaim_settings['transaction_key'] = $transaction_key;
break;
}
}
}
return $woocommerce_authorizeaim_settings;
} );
/**
* When placing a new WC order by submitting formidable,
* set order's customer detail according to the submitted information.
*/
add_action( 'woocommerce_new_order', 'ff_update_customer_data', 10, 2 );
function ff_update_customer_data($order_id,$order){
$postdata = $_POST;
$email = $postdata['la_email'];
$username = $postdata['la_email'];
$args = array(
'user_email' => $email,
'display_name' => $postdata['la_first_name'],
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name']
);
$userdata = wc_create_new_customer($email,$username,'',$args);
$userdata = json_decode(json_encode($userdata), true);
if(isset($userdata['errors'])){
$customer = get_user_by('email',$email);
if($customer){
$user_id = $customer->ID;
}
}else{
$user_id = $userdata;
update_user_meta($user_id, "first_name",$postdata['la_first_name']);
update_user_meta($user_id, "last_name",$postdata['la_last_name']);
}
$address = array(
'first_name' => $postdata['la_first_name'],
'last_name' => $postdata['la_last_name'],
'email' => $email,
'phone' => $postdata['la_ower_phone'],
'address_1' => $postdata['la_buisiness_adddress_1'],
'address_2' => $postdata['la_buisiness_adddress_2'],
'city' => $postdata['la_buisiness_adddress_city'],
'state' => $postdata['la_buisiness_adddress_state'],
'postcode' => $postdata['la_buisiness_adddress_zipcode'],
'country' => 'US'
);
$order = new WC_Order($order_id);
$order->set_customer_id($user_id);
$order->set_address($address, 'billing');
$order->set_address($address, 'shipping');
$order->save();
}
/**
* Link formidable entry with woocommerce order. -- ⇩⇩⇩ --
*/
// 1. Store formidable entry ID in the customer session.
add_action( 'frm_after_create_entry', function( $entry_id, $form_id ) {
WC()->session->set( 'frm_entry_id', $entry_id );
}, 20, 2 );
// 2. Set formidable entry id from session to the order as an order meta.
add_action( 'woocommerce_checkout_create_order', function( $order, $data ) {
if ( $entry_id = WC()->session->get( 'frm_entry_id' ) ) {
$order->update_meta_data( '_frm_entry_id', $entry_id );
}
}, 10, 2 );
// 3. Display the link to the formidable entry on the order details page.
add_filter( 'woocommerce_order_item_display_meta_key', function( $display_value, $meta ) {
if ( $meta->key == '_formidable_form_data' ) {
$display_value = __( 'Formidable Entry', 'formidable-woocommerce' );
}
return $display_value;
}, 10, 2 );
How to Get a Wholesale License in Virginia | Fast Filings
Skip to content
How To Get AWholesale Licensein Virginia.
Virginia businesses that want a tax exemption from paying sales taxes on goods they intend to resell will need to obtain a wholesale license.
A wholesale license might go by several other names, including:
Virginia Resale Certificate
Resale License
Virginia Wholesale Certificate
Virginia Sales and Use Tax Certificate of Exemption
Virginia Sales and Use Tax Permit of Exemption
Virginia Sales and Use Tax License of Exemption
Regardless of what you call it, if you no longer wish to pay sales taxes on the goods you sell your customers, you need to know how to get a wholesale certificate.
Apply for a Virginia Wholesale License!
Need help filing your wholesale license in Virginia?
What Does a Wholesale Certificate Entitle My Business To?
When you purchase products to resell, you will not have to pay Virginia sales tax to your suppliers and vendors. The sales tax is still paid, but not until you sell the items and collect the sales tax from your customers. Once collected, you send the money to the Virginia Department of Taxation.
Who Needs a Virginia Wholesale License?
Any business that does not wish to pay sales tax on the goods it resells needs a resale certificate. The primary purpose of the license is to provide proof the business is exempt from paying sales tax.
It is essential to remember that this tax exemption is only valid on items that are to be resold. Therefore, you cannot be exempt from taxes on items purchased for the business’s day-to-day operations, such as computers, office supplies, office furniture, etc.
Is There a Difference Between a Wholesale Certificate and a Seller’s Permit?
There is a difference between a wholesale certificate and a seller’s permit in Virginia. A wholesale certificate allows you to buy products tax-free in bulk for resale, while a seller’s permit allows you to collect sales tax from customers. A seller’s permit is required for all Virginia businesses that sell goods and services to consumers.
A seller’s permit is also known by the following names:
Sales Tax ID
Sales Tax Permit
Sales Tax License
Virginia Sales and Use Tax Certificate
Virginia Sales and Use Tax Permit
Virginia Sales and Use Tax License
Virginia is among a handful of states that require businesses to obtain a seller’s permit and a wholesale certificate and keep these two as separate documents.
If your wholesale business doesn’t have a Virginia wholesale certificate or a Virginia state resale certificate, you’re not legally allowed to purchase goods tax-free or resell them.
Without these documents, you could face:
Fines and penalties from the state for noncompliance
Back taxes owed on purchases that should have been exempt
Legal issues for operating without a valid seller’s permit
Refusal from suppliers who require proper documentation
Many wholesalers in Virginia will not do business with anyone who cannot provide a valid resale certificate. Trying to operate without one puts your business at financial and legal risk.
Obtaining your wholesale certificate in Virginia requires three simple steps when you apply through FastFilings.
Step 1: Gather all relevant business information.
You will want to have several types of information handy for filling out your application, including:
Business License
Business Structure (i.e., sole proprietorship, partnership, limited liability company, etc.)
Business Tax ID Number
Federal Tax ID Number/Social Security Number
Business Address and Phone Number
Vendor and Supplier Information
Bank Account Information
Email Address
Step 2: Complete your secure online application form.
At FastFilings, our online application form for your wholesale certificate is secure. You just need to enter the required information on the form. We will review your application and, if necessary, contact you if we need additional information or if you made mistakes.
Step 3: Wait for your Virginia wholesale certificate.
We will fill out the official State of Virginia application form for your resale certificate on your behalf. Since we file your application electronically with the state, you can have your wholesale certificate as fast as 24 to 48 hours.
Once we receive confirmation from the state of Virginia that your application was approved, we will send you your wholesale certificate electronically. After you receive your wholesale certificate, be sure to provide a copy of it to all of your vendors and suppliers to avoid having to pay sales tax on items you intend to resell.
We Make It Easy to Start Your VA Wholesale Business
We help businesses avoid paperwork headaches with fast processing, clear instructions, and a simple online experience. Contact us to learn more, or apply for your seller’s permit or wholesale license online right now!