value minus value

More
12 years 3 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
12 years 3 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 review. Thanks!

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

More
12 years 3 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
12 years 3 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 review. Thanks!

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

More
12 years 3 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
12 years 3 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 review. Thanks!

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

More
12 years 3 months ago #42635 by days of summer
Replied by days of summer on topic value minus value
thanks for replying Mr ggppdk
i tried but there are no errors in the page
when i put the code in the template file it works well

but i want to show it inside a field
please help me as the whole website is now depending on that
thanks

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

More
12 years 3 months ago #42649 by days of summer
Replied by days of summer on topic value minus value
HELP PLEASE : (

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

More
12 years 3 months ago #42651 by ggppdk
Replied by ggppdk on topic value minus value
Hello

- the above code is very easy for me to add it to your custom template as column
... but to create a new field takes time, and don't want to hack existing fields

so let's do the first (the second (=create a new field will be done at an appropriate time and after some more thought/planning)

which template are you using ? a copy of the 'default' template?

you want this in category layout of the template or in item layout too ?


-- 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 review. Thanks!

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

More
12 years 3 months ago #42657 by days of summer
Replied by days of summer on topic value minus value
thanks for replying Mr ggppdk
i am really lucky because you are here with us

i am using a copy of the default template

and it would be very good if the field is shown in the category and item view
but if i have to choose i will need it to be in the category view in the first priority

thanks for helping us Mr ggppdk

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

Moderators: vistamediajoomlacornerggppdk
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
Save