Moonsoft Software Solutions

calculation in array of values:

Started 5 Jun 2015 · 4 replies

  1. bsnline
    Hi,

    problem calculation in array of values.

    field: weight , width , length , height .

    for quote shipping cost, i have more packages to calculate the total volume and total weight

    suggestion ?

    $result='WeightDimensions';
    for($i=0;$i
    $result.='<tr>';
    $result.='<td>'.$weight.'</td>';
    $result.='<td>';
    $result.='<td>'.$width.'*'.$length.'*'.$height.'</td>';
    $result.='</tr>';
    }
    $result.='</tbody></table>';

    ## calculate volume for field array.

    volume=0
    if($i=0;$volume=(>$i($width*$length*$height));$i++){
    $volume=($width*$length*$height);
    }'

    Edited by bsnline - 05.06.2015 12:01
  2. Moonsoft support
    Hi,
    the forum strips some tags, so if you have a question regarding code please open a ticket using your helpdesk instead. Please specify which is exactly the problem (the code has an error?), and paste your code there.

    Thanks, regards
  3. bsnline
    No error, but not result calc array.

    code:

    $volume0=($lungo*$largo*$alto);
    $volume1=($lungo*$largo*$alto);
    $volume2=($lungo*$largo*$alto);
    $volume3=($lungo*$largo*$alto);
    $volume4=($lungo*$largo*$alto);
    $volume_sped=($volume0+$volume1+$volume2+$volume3+$volume4)
    $volume_sped=$volume.' m3';
  4. Moonsoft support
    Hi,

    Maybe the last 2 lines should be slightly different:

    $volume=($volume0+$volume1+$volume2+$volume3+$volume4);
    $volume_sped=$volume.' m3';

    Regards,
  5. bsnline
    Okay, Thank you

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket