• Resolved cluber22

    (@cluber22)


    I am essentially looking for a flag in WC to tell me whether tax should be added or not, based on the current customer.

    The current set up of my shop is that have enter product prices excluding tax, and I display them on my shop including tax.

    Settings:
    (1) Calculate tax based on: Customer shipping address
    (2) Display prices in the shop: Including Tax
    (3) Display prices during cart and checkout: Including Tax

    Example:
    Product Price: 30 (excluding tax)
    Product Price displayed on shop: 36 (including tax, automatically adjusted based on setting (2) above. 0.2 * 30 = 6. 30 + 6 = 36)

    How do I get the value of 36 in my PHP plugin? I need to replicate what WC is doing to get to the value of 36.

    I can get the value of 30 no problem using:

    $product->get_price()

    But I need to take the tax into account, depending on the users location, like WC does.

    Any help would be greatly appreciated.

    • This topic was modified 6 years, 2 months ago by cluber22.
    • This topic was modified 6 years, 2 months ago by cluber22.
    • This topic was modified 6 years, 2 months ago by cluber22.
    • This topic was modified 6 years, 2 months ago by cluber22.
    • This topic was modified 6 years, 2 months ago by cluber22.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Getting product price plus tax’ is closed to new replies.