• On the product page, when i enter a decimal number that is less than 1, such as 0.1 -> 0.9, it will be rounded up to 1 ,when i put it in the cart. But if you enter a number that is greater than 1, such as 1.1 or more, the quantity in the cart will work normally.

    please help me.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author wpgear

    (@wpgear)

    Hi marchwrx!

    Can I see a page with such a product on your site?

    Thread Starter marchwrx

    (@marchwrx)

    Here my link

    ???????? (kg) -Sample – PC Daily

    Previously this worked fine, I wanted it not to be rounded up when entering a number less than 1.

    Plugin Author wpgear

    (@wpgear)

    1. Try temporarily switching to any standard Theme: 2021-2024
    2. See how the process of adding to cart will happen. I think everything will be OK.
    3. Your Theme: “freshio” from ThemeForest. This Theme is not in the WP repository. Therefore, I can’t check.
    Plugin Author wpgear

    (@wpgear)

    OK. Sorry.
    I updated WP & Woo and now it doesn’t work for me either. ((

    Conducted an investigation:

    In new (block) versions, WooCommerce Mini Cart is not able to process decimal values: “Min”, “Max”, “Step”, “Default”.

    In new Woo Filters:
    – “woocommerce_store_api_product_quantity_minimum”
    – “woocommerce_store_api_product_quantity_maximum”
    – “woocommerce_store_api_product_quantity_multiple_of”
    It is hard only Integer. Without the possibility of change.

    See:

    public function get_args() {
    return [
    [
    'methods' => \WP_REST_Server::CREATABLE,
    'callback' => [ $this, 'get_response' ],
    'permission_callback' => 'return_true', 'args' => [ 'key' => [ 'description' => ( 'Unique identifier (key) for the cart item to update.', 'woocommerce' ),
    'type' => 'string',
    ],
    'quantity' => [
    'description' => __( 'New quantity of the item in the cart.', 'woocommerce' ),
    'type' => 'integer',
    ],
    ],
    ],
    'schema' => [ $this->schema, 'get_public_item_schema' ],
    'allow_batch' => [ 'v1' => true ],
    ];
    }

    ‘type’ => ‘integer’ should be float.

    I am sure that this is not a stupid Woo Mistake.
    This is done completely specially.
    And this is very sad.

    Try to use separate “Mini Car” plugins. They are available. And they work perfectly with Decimal Values.
    Choose. A lot of them.

    Thread Starter marchwrx

    (@marchwrx)

    Can you recommended Decimal Values Plugin for me?, please

    Plugin Author wpgear

    (@wpgear)

    Oh no!

    You and I may not have tastes very much.
    I might like one thing, but you – completely different.

    Here’s what is in the repository for “Mini Cart”:
    /wp-admin/plugin-install.php?s=Mini%2520Cart&tab=search&type=term

    I tried some “Mini Cart” Plugins and they work with Decimal Quantity. Even free versions.
    Choose with a functionality convenient for you.
    And the Styles can always be adjusted to the Design of your site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.