Title: Woocommerce Adding Another Quantity
Last modified: August 31, 2016

---

# Woocommerce Adding Another Quantity

 *  [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/)
 * I currently have woocommerce. What I am trying to do is add another quantity 
   which will be years on the shopping loop page. I Currently have the Product Name,
   Cost, Product Quantity and Add to Cart already on there. Then when someone add
   to cart the calculation will be the product cost times quantity and then take
   the sum times years. I just wanted to add a second quantity which will be number
   of years. How will I do that?

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

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108086)
 * Like a new column?
 * You’ll need a template change: [https://docs.woothemes.com/document/template-structure/](https://docs.woothemes.com/document/template-structure/)
 * This file: [https://github.com/woothemes/woocommerce/blob/master/templates/cart/cart.php](https://github.com/woothemes/woocommerce/blob/master/templates/cart/cart.php)
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108104)
 * I want two quantites on the same row if I can with a text box of about 4. One
   quantity textbox is the actual quantity of the item, and the second quantity 
   is the number of years. And below will be the add to cart.
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108106)
 * I don’t know what you mean by ‘number of years’ and where you want it shown exactly.
   Show screenshots.
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108110)
 * Kinda look like this…
 * <img src=”[https://camo.githubusercontent.com/231a9e58bdb59c46dfb3de21e6740e2f9ba38808/687474703a2f2f662e636c2e6c792f6974656d732f31683235335a31653262315a3232304f325831792f4272616b655f7061645f5f5f57435f4445562e706e67&#8243](https://camo.githubusercontent.com/231a9e58bdb59c46dfb3de21e6740e2f9ba38808/687474703a2f2f662e636c2e6c792f6974656d732f31683235335a31653262315a3232304f325831792f4272616b655f7061645f5f5f57435f4445562e706e67&#8243);/
   >
 * But one textbox will be “Quantity” and the other is “Number of Years”.
 * Like before I need to take the “product cost” times the “quantity”. Then what
   ever is the sum is I need to have it times the “number of years”. Then I will
   get my total cost.
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108111)
 * Here is an image link…
    [](https://camo.githubusercontent.com/231a9e58bdb59c46dfb3de21e6740e2f9ba38808/687474703a2f2f662e636c2e6c792f6974656d732f31683235335a31653262315a3232304f325831792f4272616b655f7061645f5f5f57435f4445562e706e67)
   Wanted it on the shopping loop page where it will show Quantity, Years and Add
   To Cart
 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108115)
 * Hi shadynicnack,
 * Best would be to calculate those by using a 3rd party form like Gravity Forms
   and WooCommerce. More information on how to do that at [http://www.woothemes.com/products/gravity-forms-add-ons/](http://www.woothemes.com/products/gravity-forms-add-ons/)
   and [https://docs.woothemes.com/document/woocommerce-gravity-forms-product-addons/](https://docs.woothemes.com/document/woocommerce-gravity-forms-product-addons/)
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108116)
 * I don’t have that much money and hate to ask, but… Is there any other free options?
   Or coding? Or is there a way of taking the subtotal of the cart times number 
   of years?
 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108120)
 * That’d actually be the cheapest option methinks; To do that with coding would
   require more code than can be dealt with here and you would need to get in touch
   with a web developer…
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108122)
 * It looks like I probably have to go in the code. Any good place to start? lol
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108123)
 * Ok got to ask…. what is the different between Product Add-Ons and Gravity Forms
   Product Add-Ons? Can Product Add-Ons perform two quantities?
 *  Thread Starter [shadynicnack](https://wordpress.org/support/users/shadynicnack/)
 * (@shadynicnack)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108140)
 * Another question… I have adjust my product setting. Since all my products needs
   number of years to calculate instead of quantity for its total cost. I have changed
   the quantity text to years. So it looks sort of like this…
 * Add To Cart Button
    _1_ Years
 * Now here is the first question…
 * We only have two products that need a quantity. How would I apply a quantity 
   box **just to those two products** along with years and add to cart on the shopping
   page?
 * Add To Cart Button
    _1_ Years _1_ Quantity
 * Example:
    <img src=”[https://camo.githubusercontent.com/231a9e58bdb59c46dfb3de21e6740e2f9ba38808/687474703a2f2f662e636c2e6c792f6974656d732f31683235335a31653262315a3232304f325831792f4272616b655f7061645f5f5f57435f4445562e706e67&#8243](https://camo.githubusercontent.com/231a9e58bdb59c46dfb3de21e6740e2f9ba38808/687474703a2f2f662e636c2e6c792f6974656d732f31683235335a31653262315a3232304f325831792f4272616b655f7061645f5f5f57435f4445562e706e67&#8243);/
   >
 * If I were to do it code, is it possible to copy the quantity code and replace
   the variables?
 * Second question is…
    Is it possible to add a quantity in a attribute and maybe
   get close to that same effect? Just a thought but I can put in product call Network(
   with one workstation) with one cost. Then add in addtributes with adding additonial
   workstations at a different cost, but I need to make something where it shows
   how many workstations and years they want the service. Could attribute be another
   way to go?
 *  Plugin Support [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * (@riaanknoetze)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108147)
 * > what is the different between Product Add-Ons and Gravity Forms Product Add-
   > Ons?
 * Main difference is that with Product Add-ons you can’t do any calculations afaik.
   Whereas with Gravity you’re able to say “this field times that field plus this
   random other field”.
 * > If I were to do it code, is it possible to copy the quantity code and replace
   > the variables?
 * You would need to add conditionals in the code of when to use years and when 
   to use regular quantity. The easiest would be to set those conditionals on a 
   per category basis, although that’s up to you.
 * > Could attribute be another way to go?
 * Don’t think that’ll work. It’d be the same as asking someone to set quantity /
   years on the the tags (bad example, but it works) of a blog post – meaning that’s
   not what they were designed for 🙂

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

The topic ‘Woocommerce Adding Another Quantity’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [quantity](https://wordpress.org/support/topic-tag/quantity/)

 * 12 replies
 * 3 participants
 * Last reply from: [Riaan K.](https://wordpress.org/support/users/riaanknoetze/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/woocommerce-adding-another-quantity-1/#post-7108147)
 * Status: not resolved