Is it possible to multiple values of 2 fields

More
6 years 5 months ago - 6 years 5 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: 6 years 5 months ago by ggppdk.

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

More
6 years 5 months ago - 6 years 5 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...
Last edit: 6 years 5 months ago by ggppdk.

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

More
6 years 5 months ago - 6 years 5 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...
Attachments:
Last edit: 6 years 5 months ago by ggppdk.

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

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

Nothing happens
Attachments:
Last edit: 6 years 5 months ago by ggppdk.

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

More
6 years 5 months ago - 6 years 5 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: 6 years 5 months ago by ggppdk.

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

More
6 years 5 months ago - 6 years 5 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...
Last edit: 6 years 5 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.588 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