Is it possible to multiple values of 2 fields

More
6 years 5 months ago - 6 years 5 months ago #70626 by erica
It's not possible because the server is on my plant. I have not possibility to give you the acces.
I attache the picture of fields.

In the file default_new.php (copie of value_defaut.php ) i copy

$field->{$prop}[$n] = $item->fieldvalues[48][$n] * $item->fieldvalues[49][$n];

instead of : $field->{$prop}[$n] = $item->fieldvalues[45][$n] * $item->fieldvalues[54][$n];
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 #70628 by ggppdk
Hello

you used the correct field ids and it is working now ?


-- 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 #70630 by erica
No it is not work.
My file "value_default_new.php" in folder "www\plugins\flexicontent_fields\text\tmpl"
Code:
<?php $n = 0; foreach ($values as $value) { // Skip empty value, adding an empty placeholder if field inside in field group if ( !strlen($value) ) { if ( $is_ingroup ) { $field->{$prop}[$n++] = ''; } continue; } // Add prefix / suffix //$field->{$prop}[$n] = $pretext . $value . $posttext; $field->{$prop}[$n] = $item->fieldvalues[48][$n] * $item->fieldvalues[49][$n]; // Add microdata to every value if field -- is -- in a field group if ($is_ingroup && $itemprop) $field->{$prop}[$n] = '<div style="display:inline" itemprop="'.$itemprop.'" >' .$field->{$prop}[$n]. '</div>'; $n++; if (!$multiple) break; // multiple values disabled, break out of the loop, not adding further values even if the exist }

I have a question. My fields belong to a fieldgroup. It's not a problem ? See my picture in attachment
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 #70632 by ggppdk
Hello

the problem is that the field has no value in DB
so the display stops before loading your custom display layout

Do this
- set default value to: 0
- se vaue usage: ... and show default value instead of empty


-- 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 2 months ago #71918 by erica
Hello George,

I finally succeeded to multiplicate 2 fields in following your example :
www.flexicontent.org/forum/20-general-su...l?limitstart=0#70568 .
But I have a new issue : the result of the multiplication returns only one digit (the first digit).

Could you help me ?

Attachments:

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

More
6 years 2 months ago #71919 by ggppdk
Hello

it looks like you are getting the first character of a string using the operator

[0]


-- 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.285 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