Is it possible to multiple values of 2 fields

More
8 years 4 months ago - 8 years 4 months ago #70549 by erica
Hello,

I have 2 radio fields :
field A :
4::labelA1 %% 7::labelA2

field B :
2::labelB1 %% 3::labelB2

I want a 3rd field with value = value field A x value field B

I hope it's clear, and so how make this
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70554 by ggppdk
Hello

you can do it

A. for display purposes

1. create a text field
2. create a custom viewing layout for it and select in field configuration
3. inside it do (lets say you fields , one has field id 45 and the other has field id 54)
Code:
$field->$prop[0] = $item->fieldvalues[45][0] * $item->fieldvalues[54][0];

After trying the above you can use:
Code:
if ( !isset($item->fieldvalues[45][0]) && isset($item->fieldvalues[54][0])) { $field->$prop[0] = $item->fieldvalues[45][0] * $item->fieldvalues[54][0]; } else $field->$prop[0] = '0';
)



B. For saving the value in DB, thus you can use it
- in filtering
- in modules
- etc
this is possible with our FLEXIcontent Pro version plugin (implemented but not released yet)


-- 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!
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70568 by ggppdk
Hello

here is how it will be in next version


-- 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!
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70577 by erica
Hello,
I try to test your instruction but no result.
Could you help me.

Nothing happens
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70590 by erica
Hello,

could you tell me just where i must write this code:
Code:
$field->$prop[0] = $item->fieldvalues[45][0] * $item->fieldvalues[54][0];

I don't find where you tell me.

Thank you for your help.
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70591 by ggppdk
Hello

copy
value_default.php
as
value_mylayout001.php

Edit it and

Replace:
Code:
$field->{$prop}[$n] = $pretext . $value . $posttext;

with:
Code:
$field->{$prop}[$n] = $item->fieldvalues[45][$n] * $item->fieldvalues[54][$n];


-- 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!
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70619 by erica
Hello ggppdk,
I know i am very bad. But step by step i progress.
I searched during all morning , I did exactly what you told me in your last message but without result.
After 2 steps i must make another thing ?
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70623 by ggppdk
Hello

I searched during all morning ,


It would take me 5-10 minutes to configure this

Is the website live or under development ?
- Please give me access to the website

Tell me
- the 2 fields that need to be multiplied
- the field that will contain the multiplication


Do you want to try the new beta version that support automatic value creation and storage in DB ?
- it provides much more flexibility because you really have the result stored in DB and you can even use field in filtering form


-- 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!
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70624 by erica
Thank you to help me ggppdk.
The site is under developpement.
I try to make a site in order to improve my job. Programmation is not my job but i like this and i try the evening at house. I learn in the same time.
And I am french so perhaps i don't understand all your explications.
I can try with the new beta version for not always ask your help.
Last edit: 8 years 4 months ago by ggppdk.

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

More
8 years 4 months ago - 8 years 4 months ago #70625 by ggppdk

The site is under developpement.


If site is on an online server

- Please give me access to the website

Tell me
- the 2 fields that need to be multiplied
- the field that will contain the multiplication



-- 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!
Last edit: 8 years 4 months ago by 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