This article provides an overview for developers who already have PHP experience. Its purpose is to illustrate how to display two or more prices on a card using PHP, enabling you to create your own customizations and style them accordingly. Remember to maintain all changes within the Child Theme to ensure your modifications remain compatible with future updates.


1. Create Two Price Fields


2. Input the Values


3. Modify the files responsible for displaying the price. For example:


Card V4 (Standard)

In the file wp-content/themes/listivo/templates/partials/card/listing_card_v4.php, find the following code:


<div class="listivo-listing-card-v4__value listivo-listing-card-value-selector">
                            <?php echo wp_kses_post($lstMainValue); ?>
</div>

Replace it with:

<div class="listivo-listing-card-v4__value listivo-listing-card-value-selector">
                            <?php
                            foreach (tdf_app('card_main_value_fields') as $mainValueField) {
                                $value = $mainValueField->getValueByCurrency($lstCurrentListing);
                                if (!empty($value)) {
                                echo '<div style="margin-bottom:10px">';
                                echo wp_kses_post($value);
                                echo '</div>';
                                }
                            }
                            ?>
</div>

Result:



For Row Card


In the file /wp-content/themes/listivo/templates/partials/card/listing_row_v2.php, find this section:

 <div class="listivo-listing-card-row-v2__value listivo-listing-card-value-selector">
                        <?php if (!empty($lstMainValue)) : ?>
                            <?php echo wp_kses_post($lstMainValue); ?>
                        <?php endif; ?>
</div>


Replace it with:

<div class="listivo-listing-card-row-v2__value listivo-listing-card-value-selector">
                        <?php
                        foreach (tdf_app('card_main_value_fields') as $mainValueField) {
                            $value = $mainValueField->getValueByCurrency($lstCurrentListing);
                            if (!empty($value)) {
                                echo '<div style="margin-bottom:10px">';
                                echo wp_kses_post($value);
                                echo '</div>';
                            }
                        }
                        ?>
</div>

Below, you'll see the result that you can restyle to meet your needs. For instance, via Site Settings > Ad Cards, you can alter font sizes, card height, or remove elements like descriptions to make more room for the two prices.