Title: Change Default Product Type to &#8220;Variable&#8221;
Last modified: May 23, 2020

---

# Change Default Product Type to “Variable”

 *  Resolved [mwitthus](https://wordpress.org/support/users/mwitthus/)
 * (@mwitthus)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/)
 * Is there a way to change the default product type to “Variable” for when a Vendor
   lists their products. All my vendors will be using Variable products, so the 
   Simple product type won’t be used. It’s also confusing to my vendors when they
   add a product with variations because they always miss the part where they have
   to change the product type to a Variable product.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * (@rur165)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12896837)
 * Hello [@mwitthus](https://wordpress.org/support/users/mwitthus/) ,
 * At the moment I am unable to suggest any direct hook/filter to modify the default
   product type to variable. But if you want to explore further you can take a look
   at this file – **dokan-lite\includes\Dashboard\Templates\Products.php** here 
   at line **#296** you can set the default product type.
 * Any modification in this file will be removed when Dokan Lite will be updated
   so this is not the recommended way to modify.
 * Thank you.
 *  Thread Starter [mwitthus](https://wordpress.org/support/users/mwitthus/)
 * (@mwitthus)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12896977)
 * So you’re saying whenever there is a Dokan update, the file will be changed back
   to default?
 *  [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * (@rur165)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12912898)
 * Hello [@mwitthus](https://wordpress.org/support/users/mwitthus/) ,
 * Unfortunately, yes. At the moment I am unable to suggest any direct hook to make
   the changes through a child theme. You can try with this filet “dokan_product_types”.
   In my test, I was unable to force anything other than simple product types.
 * If you only want variable product type then using that filter you can remove 
   all other product types though.
 * Thank you.
 *  Thread Starter [mwitthus](https://wordpress.org/support/users/mwitthus/)
 * (@mwitthus)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12916364)
 * Actually yeah I would like to have only variable product types. Is there a way
   I can change some code to only variable product types?
 *  [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * (@rur165)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12929233)
 * Hello [@mwitthus](https://wordpress.org/support/users/mwitthus/) ,
 * There are several ways to do that. You can simply replace these lines from **
   dokan-lite/templates/products/new-product.single.php** look for the product type
   selection codes. They should be around line #180 – [https://prnt.sc/ssnkd8](https://prnt.sc/ssnkd8)
 * Replace these lines with these –
 *     ```
       <select name="product_type" class="dokan-form-control" id="product_type">
            <?php foreach ( $product_types as $key => $value ) { if ($key == "variable") {?>
                  <option value="<?php echo esc_attr( $key ) ?>" <?php selected($product_type, $key ) ?>><?php echo esc_html( $value ) ?></option>
             <?php } } ?>
       </select>
       ```
   
 * After modification save this file under **your-theme/dokan/products** folder 
   with exact same name.
 * Alternatively, you can use this filter – dokan_product_types if you are comfortable
   to write some code for modification.
 * Thank you.
    -  This reply was modified 5 years, 11 months ago by [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/).
 *  Thread Starter [mwitthus](https://wordpress.org/support/users/mwitthus/)
 * (@mwitthus)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12929916)
 * Thank you for the info. Will this new code remain the same even when a Dokan 
   update is installed?
 * I’ve updated the file with the new code you gave me and there’s one small problem.
   After you click “Create Product”, the product is still created as a simple product.
   In order to get it to change to a variable product, the vendor must click the“
   Save Product” button on the edit product page. Once they do that, it will then
   switch to a variable product. This is not a major problem to be honest, but it
   would be nice if the product was created immediately as a variable product after
   they click “Create Product” on the first edit product page.
 *  [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * (@rur165)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12941404)
 * Hello [@mwitthus](https://wordpress.org/support/users/mwitthus/) ,
 * The file I mentioned is a template file so you are able to override the template
   file through your child theme. Save your modified file under **your-theme/dokan/
   products** folder.
 * The issue that the product is first saved as a simple product type will be hard
   to change without modifying the core files. So, I will suggest to ignore that
   part as of now.
 * Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Change Default Product Type to “Variable”’ is closed to new replies.

 * ![](https://ps.w.org/dokan-lite/assets/icon-256x256.gif?rev=3239229)
 * [Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy](https://wordpress.org/plugins/dokan-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dokan-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dokan-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/dokan-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dokan-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dokan-lite/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/change-default-product-type-to-variable/#post-12941404)
 * Status: resolved