• Resolved thompsonaire

    (@thompsonaire)


    I have an item that is sold by the gallon. I need to set up this item to sell by the 10th of a gallon. How do I accomlish this?

    1 Gallon, 1.1 Gallons, 1.2 Gallons and so on..??

    Thank you for any tips.
    Jeff

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @thompsonaire,

    Welcome to the WooCommerce support forum, and thanks for your question! I understand you’re looking to sell a product in fractional quantities, specifically in tenths of a gallon, like 1.1, 1.2, 1.3 gallons, and so on. That’s a practical setup for many volume-based products, and I’d be happy to help you get this working.

    WooCommerce doesn’t support decimal quantities out of the box for products, but you can enable this with a small code snippet or by using a plugin.

    Option 1: Use a plugin

    You can use the “WooCommerce Product Quantity” plugin, such as:

    These plugins let you define the step/increment size (e.g., 0.1) and optionally the minimum or maximum quantity allowed.

    Option 2: Add custom code (for advanced users)

    If you’re comfortable adding a custom snippet, here’s a basic example to allow decimal quantities for a specific product:

    add_filter( 'woocommerce_quantity_input_args', 'custom_decimal_quantity_step', 10, 2 );
    function custom_decimal_quantity_step( $args, $product ) {
        if ( $product->get_id() === 123 ) { // Replace 123 with your product ID
            $args['step'] = 0.1;
            $args['min_value'] = 0.1;
        }
        return $args;
    }

    You can add this to your theme’s functions.php file or via a plugin like Code Snippets.

    Thread Starter thompsonaire

    (@thompsonaire)

    Thank you!

    I have found an app that seems to work for me at the moment. I am trying to fix the shipping since this product is pumped on location and there is no shipping involved.

    Here is what I am working on.
    https://aviation-ranch.com/product/propane/

    I am having trouble removing the shipping line from the cart. But as you can see I now have the quantity part working.

    Thank you!
    Jeff

    Hi there!

    I’m glad to hear you were able to find an app that helps you achieve your goal.

    Regarding the shipping line on the cart page — I’ve checked it on my end, and I’m not seeing any shipping line displayed, as shown in this screenshot:
    https://go.screenpal.com/watch/cThqDdn6QLl

    Just to confirm, were you able to remove that line as well? Or do you still need help with it? If so, could you please share a screenshot of the specific line you’re referring to, so we can take a closer look and assist you accordingly? You can use this tool to upload your screenshot: https://snipboard.io

    Thank you!

    Plugin Support Kay U a11n

    (@kingsleyinfo)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

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

The topic ‘Selling in Tenths’ is closed to new replies.