Enhance pricing card functionality by adding price and pricePer attributes for better clarity and user experience

This commit is contained in:
Matt Batchelder
2026-02-21 00:53:13 -05:00
parent 01235c2042
commit 0420be8bd6
4 changed files with 26 additions and 5 deletions

View File

@@ -513,6 +513,8 @@ add_action( 'init', function () {
'faIcon' => [ 'type' => 'string', 'default' => '' ],
'name' => [ 'type' => 'string', 'default' => '' ],
'tagline' => [ 'type' => 'string', 'default' => '' ],
'price' => [ 'type' => 'string', 'default' => '' ],
'pricePer' => [ 'type' => 'string', 'default' => '' ],
'features' => [ 'type' => 'array', 'default' => [] ],
'btnText' => [ 'type' => 'string', 'default' => 'Get Started' ],
'btnUrl' => [ 'type' => 'string', 'default' => '/contact' ],
@@ -1296,6 +1298,12 @@ function oribi_render_pricing_card( $a ) {
<?php if ( oribi_has_icon( $a ) ) : ?><div class="feature-icon" style="margin-inline:auto;"><?php echo oribi_render_icon( $a ); ?></div><?php endif; ?>
<div class="pricing-name"><?php echo esc_html( $a['name'] ); ?></div>
<p class="pricing-tagline"><?php echo wp_kses_post( $a['tagline'] ); ?></p>
<?php if ( ! empty( $a['price'] ) ) : ?>
<div class="pricing-price">
<div class="pricing-amount"><?php echo wp_kses_post( $a['price'] ); ?></div>
<?php if ( ! empty( $a['pricePer'] ) ) : ?><div class="pricing-per"><?php echo wp_kses_post( $a['pricePer'] ); ?></div><?php endif; ?>
</div>
<?php endif; ?>
<ul class="pricing-features">
<?php foreach ( ( $a['features'] ?? [] ) as $f ) : ?>
<li><span class="pricing-check">&#10003;</span> <?php echo wp_kses_post( $f ); ?></li>