C
C
Christina2018-02-17 03:49:41
PHP
Christina, 2018-02-17 03:49:41

How to add the function of manual entry and saving the price?

Good day!
There is a field for displaying the price:

<div class="item-price xxx">
                  <?php if ($item_price_list): ?>
                    <?= number_format($item_price_list, 0, '.', ' ') ?> руб.
                  <?php else: ?>
                    <?= $item_price ?>
                  <?php endif; ?>
                </div>

It is formed by this formula:
function app_block_node_load($nodes, $types) {
  foreach ($nodes as $nid => $node) {
    if ($node->type === 'works' && $node->field_work_ext1['und'][0]['value'] == 'Газобетон + кирпич') {
      $nodes[$nid]->field_price_for_list['und'][0]['value'] = $node->field_work_ext2['und'][0]['value'] * 13000;
    }
  }

How can I make it possible to manually change and save the price?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima, 2018-02-17
Dolgoter @DDolgy

Save it to the database, then manually change it there

M
Mikhail Bobkov, 2018-02-17
@mike_bma

You need a form to change data.
Conservation - where did you get these melons?
Here there and to save in a script of processing of the form.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question