I used this and its working now, Thanks for your time!
<?php
$total = 0;
while(the_repeater_field(‘information’ )):
$total += intval( get_sub_field(‘amount_paid’ ) );
endwhile;
echo $total;
?>
Hello, McGee
The whole code is here https://support.advancedcustomfields.com/forums/topic/how-to-display-addition-sum-of-number-field-in-repeator/
I tried this
<?php
$total = 0;
while(the_repeater_field(‘information’ )):
the_sub_field(‘amount_paid’ );
$total += intval( get_sub_field(‘amount_paid’ ) );
endwhile;
echo $total;
?>
But its showing all numbers together, not as total!
It gave me output as 1000012707, should be 10000+12707
<?php $post = get_post(page_id); ?><?php the_field(‘field_name’); ?>
Hello,
For showing google maps you have to integrate google api, create a project from your google dashboard, you can use same key for multiple websites owned or developed by you.
reference– https://www.advancedcustomfields.com/blog/google-maps-api-settings/
* attach screen if this doesn’t solve your issue
Hello,
You can’t display any php code in HTML.
Solution: create your invoice template in php and allow users to download as a PDF.
USE: <?php the_field(‘termen_de_plata ‘); ?>
<div style=”background-color:<?php $post = get_post(page_id); ?><?php the_field(‘field_name’); ?>”>Something here…</div>
*replace page id with the id, where you created the backend ‘select color’
** replace field name with the field you created in acf for color picker
Hello, You have to create custom posts by writing codes in functions.php, better to take help of developer or else your whole website will go down.
There will be no issues as you can always integrate the shortcode or field to their ‘shoppage- php file’ and can display field anywhere through php loops.
Hello,
For showing google maps you have to integrate google api, create a project from your google dashboard, you can use same key for multiple websites owned or developed by you.
reference– https://www.advancedcustomfields.com/blog/google-maps-api-settings/
Hello,
Cheers!
Thanks John, it worked.
Hey, Its INR
You have to add the code in your page where you want to display the output,
example:
<?php $output = get_field(‘on-road_price’); $price = number_format( $output, 0, ”, ‘,’); echo $price; ?></p>
Replace ‘on-road_price’ with your field name.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.