Home › Forums › Add-ons › Repeater Field › Product List › Reply To: Product List
just to understand correct:
you talk about frontend output?
goal is: to have a select-box that contains product quantity, and if you select one, then you wish that at a different place the value of price is displayed?
i assume for that you need javascript.
try something like that
//html build with your repeater values (get quantity and price)
<select id="quantity" name="quantity" required>
<option name="quantity" value="1" data-price="5 Bucks">1</option>
<option name="quantity" value="5" data-price="25 Bucks">5</option>
<option name="quantity" value="10" data-price="50 Bucks">10</option>
<option name="quantity" value="$quantity" data-price="$price">$quantity</option>
</select>
<span id="price-text"></span>
----
//javascript (jQuery needed)
<script type="text/javascript">
$(document).ready(function () {
$("#quantity").change(function() {
$('#price-text').text($('option:selected').attr('price-example'));
}).change();
});
</script>
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.