Support

Account

Home Forums General Issues How should I sort the array and order based on value?

Unread

How should I sort the array and order based on value?

  • Hi.

    I configured the field to enter the name and amount of a specific company in woocommerce product information.

    And I want to display the value entered in that information.
    I want to output only a list of values ​​entered in value, and I want to organize the order in DESC based on value. What should I do?

    And how do I expose the entered information to search results?
    (i used to functions.php)

    code

    <?php
    $fields = get_field_objects();
    if($fields): ?>

      <?php foreach( $fields as $field ): ?>

    • <?php echo $field[‘label’]; ?>: <?php echo $field[‘value’]; ?>
    • <?php endforeach; ?>

    <?php endif; ?>

Viewing 1 post (of 1 total)

The topic ‘How should I sort the array and order based on value?’ is closed to new replies.