Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

MULTIPLY FUNCTION 12.02.2013 15:51

Could you please tell how can I multiply option list value with linked list value.
if option list value is 5 and linked list is 5_10, so logically, the formula must contain 5x10, but unfortunately I can't get to this line.

$result=$option*$option_linked (but the result is 5*5, not 5*10)

so, the question is how correctly write a formula to get the multiplation 5*10

Re: MULTIPLY FUNCTION 12.02.2013 16:38

Hello,
yes, when you recover the value of the $option_linked, you get the whole value

(5_10)

In order to use the values inside a formula, you should previously 'split' that value in two pieces, and use the second part to build your math. This is the code needed:

$myvalue=explode("_",$option_linked);

//Now you have at 'myvalue' the two separate parts.
// $myvalue[0] contains the first part
//$myvalue[1] contains the second part

//So you can use

$result=$option*$myvalue[1];

//to multiply 5*10

Hope this helps, regards
Moonsoft Team
www.moonsoft.es

Re: MULTIPLY FUNCTION 12.02.2013 17:19

Thank you
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback