• Resolved Dani

    (@danicasati)


    Hi.
    Is it possible to display conditional text on single product based on tax class?

    For example:
    – If single product tax class is STANDARD, then show X
    – If single product tax class is ZERO, then show Y

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Dani F. a11n

    (@danielinhou)

    Hi @danicasati ????

    Is it possible to display conditional text on single product based on tax class?

    What kind of text would that be? If you are referring to the Tax description you can edit that one under **WooCommerce > Settings > Tax > Standard rates** in the Tax name field


    Link to image: https://d.pr/i/cTE8cF

    If you would like to display any other text based on the Tax Class used by that product that would be a different issue but keep us posted, we’ll be glad to help!

    Cheers!

    Thread Starter Dani

    (@danicasati)

    No.
    I need to get tax class of a product and then execute some function in single product page based on tax class slug.

    Nico

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there,
    You can use the get_shipping_class method to get the product shipping class and then use that value for your conditions.

    Thread Starter Dani

    (@danicasati)

    I need to retrieve TAX CLASS, not SHIPPING CLASS of a product.

    Rambo

    (@rahul020691)

    Hi @danicasati,

    You can use the get_tax_class method to get the tax class and then use that value for your conditions.

    Hope that helps!

    Plugin Support abwaita a11n

    (@abwaita)

    Hi @danicasati,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, the above info was helpful!

    If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conditional text on single product based on tax class’ is closed to new replies.