R
R
Raz1el2015-10-07 13:24:18
PHP
Raz1el, 2015-10-07 13:24:18

Make the span change?

There is a span - uc-price
There are 2 inputs in the admin panel, 1 for euros, 1 for rubles
prices on the site in rubles.
Gently make the final price - span id="uc-price" and the input.rub field have the following formula -
uc-price = input.euro.value * kurs.value There
is a course value, I don't know much about php.
and accordingly, when changing kurs.value, all goods were recalculated

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivanq, 2015-10-07
@Raz1el

$euro = 1234567890; // Данные в EURO
$kurs = 2; // Ваш курс
$uc_price = $euro * $kurs;
echo "<span id='uc-price'>$uc_price</span>";
echo "<input class=rub value='$uc_price'>";
echo "<input class=euro value='$euro'>";

If something is not clear, ask

T
Tlito, 2015-10-07
@tlito

> span id="uc-price" and field input.rub
your question is in php and html terms, and only the word "field" somehow refers to Drupal.
study the variables in the_entity_view
hook, install the devel module
and write the command in the hook
and the code has already been hinted to you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question