IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '26,063'), ".035"," ")
I would like to include another IF statement in this equation for when fieldname4 = another value. The singular equation would be:
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '38,044'), ".049","”)
This does not work:
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '26,063'), ".035","");
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '38,044'), ".049","”);
Is there a specific way to write these two statements to have them both work?
Thanks so much!
]]>I want to check two values of two different fields.
If they match, output should be Calc. A.
If they don’t, output should be Calc. B.
Input in advanced equations editor:
(function(){
IF(fieldname14==fieldname11) return Calc. A; Calc B;
})();
Where is my mistake in my logic? I regret my Java skills are not state of the art anymore.
Kind regards.
]]>post_id 000.011
post_title test
undefined2 4,5
undefined3 10
undefined4 4,5
undefined5 20 // stock
undefined6 30 // orders from clients
undefined7 120 // available stock for backorders
undefined8 111
I want to make a minus for stock quantity like
[MATH({undefined5[1]},”-“,{undefined6[1]})] and tha is ok when the result is nevative.
I dont want the negative number for stock.
In this case i want to show as stock quantity = 0 and the difference in result to be deducted from available stock for backordes.
if ( {undefined5[1]} – {undefined6[1]} <=0 )
{undefined5[1]} = 0;
else if ( {undefined5[1]} – {undefined6[1]} > 0 )
{undefined5[1]} = {undefined5[1]} – {undefined6[1]};
else if ( {undefined5[1]} – {undefined6[1]} <0 )
{undefined7[1]} = ( {undefined5[1]} – {undefined6[1]} ) + {undefined6[1]} )
Can i have this result with if statement with syntax like that I saw in another topic?
“” [IF({promopricec[1][.=”.00″]})][ELSE]{promopricec[1]}[ENDIF] “”
Or with php function, if you can tell me how to get and define {undefined5[1]}, {undefined6[1]}, {undefined7[1]} in function and how to get the function to fields
thanks you.
]]>i couldn’t found any direct solution for my problem so i hope anybody can help we with this.
It is possible to work with if-Statements for emails in CF7? I need to send a specific text if the phone field is empty.
In short:
if(phonefield == empty) -> Display randomnumber in email instead of phone number
Thanks in advance
]]>I get confused why the calculator doesn’t work when I’m trying to enter this formula
((function(){
if(fieldname8< 7,850,000) return fieldname8*2.22;
if(fieldname8=7,850,000) return fieldname8*2;
if(fieldname8>7,850,000) return fieldname8*2;
})()
I am trying to make a condition if the user results in fieldname8 below than 7,85 million then the fieldname8 would times by 2.22 to be shown in the fieldname 9 as a result.
if anyone can help me that would be great. Thanks in advance!
]]>Ideally I would like to use the same page with two HTML card templates and us an ‘if’ statement to choose which of the templates to display depending on the post-type.
My question is how to structure the ‘if’ statement to detect the post-type and them display the proper one.
]]>However, because my shop page uses archive-product.php template file and post_type=product, the custom category loop doesn’t work on the shop page specifically. How can I have multiple loops on archive.php dependent on different conditions?
I haven’t found the same question here yet. Based on this documentation, I’m using is_shop for the shop page loop, and is_product_category() for the category loop.
This is my archive-product.php template file but it results in the shop page loop not displaying any products:
<?php
if ( woocommerce_product_loop() ) {
/**
* Hook: woocommerce_before_shop_loop.
*
* @hooked woocommerce_output_all_notices - 10
* @hooked woocommerce_result_count - 20
* @hooked woocommerce_catalog_ordering - 30
*/
do_action( 'woocommerce_before_shop_loop' ); ?>
<ul class="wpf-search-container products">
<li class="product">
<?php
// Get The queried object ( a WP_Term or a WP_Post Object)
$term = get_queried_object();
// To be sure that is a WP_Term Object to avoid errors
if( is_a($term, 'WP_Term') ) :
if ( is_product_category() ) :
// Setup your custom query
$loop = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => -1,
'post_status' => 'publish',
'tax_query' => array( array(
'taxonomy' => 'product_cat', // The taxonomy name
'field' => 'term_id', // Type of field ('term_id', 'slug', 'name' or 'term_taxonomy_id')
'terms' => $term->term_id, // can be an integer, a string or an array
) ),
) );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();
the_post_thumbnail( 'thumbnail');
endwhile;
wp_reset_postdata(); // Remember to reset
endif; endif;
?>
<?php
if ( is_shop() ) :
// Setup your custom query
$loop = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => -1,
'post_status' => 'publish',
) );
if ( $loop->have_posts() ) :
while ( $loop->have_posts() ) : $loop->the_post();
the_post_thumbnail( 'thumbnail');
endwhile;
wp_reset_postdata(); // Remember to reset
endif; endif; endif;
?>
</li>
</ul>
]]>Bu the problem now is, is when I field is empty, the label still is shown in the email body.
I was wondering… Is there an IF STATEMENT possible within the email action?
if (empty(field_x) then hide the field…
]]>