If statement with math
-
Hello,
I have this csv with productspost_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 111I 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.
- The topic ‘If statement with math’ is closed to new replies.