Skip to content

Woocommerce Rest API - Get Order Items With Float Quantity #263

@stevemiller3

Description

@stevemiller3

Hi,

In Woocommerce Rest API, I need to get the quantity of items from orders (Get) in float format and on the frontend (what the clients see) should remain in integer format.

For ex:

If the client orders 2 items:

2 itemA

3 itemB

The Rest API should return:

0.2 itemA

0.3 itemB

This is because the client buys a pack and the pack is 0.1 gramms. I need to get in gramms because I use an accounting software that I bought that I can't modify.

I found this stackoverflow question, where the Rest API quantity datatype is changed from int to float, but I don't know where I need to modify: quantity*0.1.

Woocommerce API - Create Order With Float Quantity

Question: Where do I need to change in Rest API, to change the quantity to quantity 0.1?*

Thanks advanced,
Steve

PS: I know that if I modify, I will not be able to use the autoupdate function, but is not problem for me and also the total quantity would change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions