new pricing

This commit is contained in:
Matt Batchelder
2026-05-12 14:11:39 -04:00
parent cb9d31e8a8
commit 6a883b24bf
3 changed files with 19 additions and 16 deletions

View File

@@ -541,6 +541,7 @@ add_action('init', function () {
'pricePer' => ['type' => 'string', 'default' => ''],
'annualPrice' => ['type' => 'string', 'default' => ''],
'annualPer' => ['type' => 'string', 'default' => ''],
'annualMonthly' => ['type' => 'string', 'default' => ''],
'annualSavings' => ['type' => 'string', 'default' => ''],
'features' => ['type' => 'array', 'default' => []],
'btnText' => ['type' => 'string', 'default' => 'Get Started'],
@@ -1860,11 +1861,12 @@ function oribi_render_pricing_card($a)
}
$has_annual = !empty($a['annualPrice']);
$monthly_price = $a['price'] ?? '';
$monthly_per = $a['pricePer'] ?? '';
$annual_price = $a['annualPrice'] ?? '';
$annual_per = $a['annualPer'] ?? '';
$annual_savings = $a['annualSavings'] ?? '';
$monthly_price = $a['price'] ?? '';
$monthly_per = $a['pricePer'] ?? '';
$annual_price = $a['annualPrice'] ?? '';
$annual_per = $a['annualPer'] ?? '';
$annual_monthly = $a['annualMonthly'] ?? '';
$annual_savings = $a['annualSavings'] ?? '';
ob_start(); ?>
<div class="pricing-card<?php echo $featured ? ' featured' : ''; ?>">
@@ -1882,9 +1884,11 @@ function oribi_render_pricing_card($a)
<p class="pricing-tagline"><?php echo wp_kses_post($a['tagline']); ?></p>
<?php if ($monthly_price): ?>
<div class="pricing-price">
<div class="pricing-amount"><?php echo wp_kses_post($monthly_price); ?></div>
<?php if ($monthly_per): ?><div class="pricing-per"><?php echo wp_kses_post($monthly_per); ?></div><?php endif; ?>
<div class="pricing-amount pbt-show-monthly"><?php echo wp_kses_post($monthly_price); ?></div>
<?php if ($monthly_per): ?><div class="pricing-per pbt-show-monthly"><?php echo wp_kses_post($monthly_per); ?></div><?php endif; ?>
<?php if ($has_annual): ?>
<div class="pricing-amount pbt-show-annual" hidden><?php echo wp_kses_post($annual_monthly ?: $monthly_price); ?></div>
<div class="pricing-per pbt-show-annual" hidden><?php echo wp_kses_post($monthly_per); ?></div>
<div class="pricing-per pbt-show-annual" hidden><?php echo wp_kses_post($annual_price); ?> billed annually<?php if ($annual_savings): ?> &mdash; <span class="pricing-savings-inline"><?php echo esc_html($annual_savings); ?></span><?php endif; ?></div>
<?php endif; ?>
</div>