value minus value

More
10 years 11 months ago #42510 by days of summer
Hi,
i have a question please

is that possible to make a field that
shows result of
(Value of field1) minus or plus (value of field2)
?

that will help to use flexicontent in many things other than articles

i am making a website for a shop
and trying to make some basic calculation functions between the fields

like + and -

i hope that will be possible
and thanks for your great support

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42512 by ggppdk
Replied by ggppdk on topic value minus value
Hello,
yes use raw field values inside your template (category_items.php or item.php file of you custom flexicontent template):
Code:
$field_id1 = 55; $field_id2 = 55; $flds_arr = & $item->fieldvalues; echo $flds_arr[$field_id2][0] - $flds_arr[$field_id1][0];

if your field is multiproperty e.g. weblink field
then please read this for more information
Using the raw value of a field inside a template file


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42519 by days of summer
Replied by days of summer on topic value minus value
Thanks Mr ggppdk for your fast reply

can i use the
Code:
echo $flds_arr[$field_id2][0] - $flds_arr[$field_id1][0];
inside a field ?

as i wanted to show the result of the equation inside a field in the same item

as this example in the image
the earning = (selling) - (purshase)



can i use this method inside the earning field ?

thanks

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42529 by ggppdk
Replied by ggppdk on topic value minus value
hello

i guess you could use these inside a field for the purpose of creating the fields displayed HTML


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42580 by days of summer
Replied by days of summer on topic value minus value
i tried to
put this code inside the template file
Code:
<?php $field_id1 = 55; $field_id2 = 55; $flds_arr = & $item->fieldvalues; ?>
and this in the an text field default value
Code:
echo $flds_arr[$field_id2][0] - $flds_arr[$field_id1][0];

but i shows nothing : (
do i use it right ?
thanks

Please Log in or Create an account to join the conversation.

More
10 years 11 months ago #42604 by ggppdk
Replied by ggppdk on topic value minus value
hello

1. do you still have error reporting on in Joomla Global configuration / Server TAB
please enable again

2. if you put inside the file this
echo "This point is reached";

do you see the above text ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.326 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline