Title: Proper syntax for nested &#8220;IF&#8221;
Last modified: April 15, 2021

---

# Proper syntax for nested “IF”

 *  Resolved [rvalsot](https://wordpress.org/support/users/rvalsot/)
 * (@rvalsot)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/proper-syntax-for-nested-if/)
 * Hello, I’m having a trouble with either with my pro activation or with the syntax
   of my formula, because of a nested if.
    Pseudo code version should be:
 *     ```
       if(product_taxonomy attribute="a") {
         p2 * x -> "the price of the product as you advice"
       } else(attribute="b"){
         p2 * [product_weight] *
           if(product_tag tag="a" ) {p4} elseif(product_tag tag="b") {p5} ... else{p#}
       }
       ```
   
 * I get a return value always equal, and it shouldn’t be the case. And I couldn’t
   find an example at your site’s documentation
    -  This topic was modified 5 years, 1 month ago by [rvalsot](https://wordpress.org/support/users/rvalsot/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [prowcplugins](https://wordpress.org/support/users/prowcplugins/)
 * (@prowcplugins)
 * [4 years, 11 months ago](https://wordpress.org/support/topic/proper-syntax-for-nested-if/#post-14590664)
 * Hi [@rvalsot](https://wordpress.org/support/users/rvalsot/),
 * Thank you so much for your query.
 * You can use for this nested if:
 *     ```
       if(product_taxonomy attribute=="a") {
           p2 * x -> "the price of the product as you advice"
       }
       elseif(attribute=="b"){
           p2 [product_weight] *
              if(product_tag tag=="a" ) {p4} elseif(product_tag tag=="b") {p5} ... else{p#}
       }
       ```
   
 * I hope you got the solution.
 * Plus one more thing, if you need any kind of quick support for premium products
   then please create a support ticket to our support portal via filing the form
   to this link, [https://prowcplugins.com/support/](https://prowcplugins.com/support/)
 * Thank you!

Viewing 1 replies (of 1 total)

The topic ‘Proper syntax for nested “IF”’ is closed to new replies.

 * ![](https://ps.w.org/product-price-by-formula-for-woocommerce/assets/icon-256x256.
   png?rev=2567213)
 * [Product Price by Formula for WooCommerce](https://wordpress.org/plugins/product-price-by-formula-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [prowcplugins](https://wordpress.org/support/users/prowcplugins/)
 * Last activity: [4 years, 11 months ago](https://wordpress.org/support/topic/proper-syntax-for-nested-if/#post-14590664)
 * Status: resolved