new pricing
This commit is contained in:
@@ -539,6 +539,9 @@ add_action('init', function () {
|
||||
'tagline' => ['type' => 'string', 'default' => ''],
|
||||
'price' => ['type' => 'string', 'default' => ''],
|
||||
'pricePer' => ['type' => 'string', 'default' => ''],
|
||||
'annualPrice' => ['type' => 'string', 'default' => ''],
|
||||
'annualPer' => ['type' => 'string', 'default' => ''],
|
||||
'annualSavings' => ['type' => 'string', 'default' => ''],
|
||||
'features' => ['type' => 'array', 'default' => []],
|
||||
'btnText' => ['type' => 'string', 'default' => 'Get Started'],
|
||||
'btnUrl' => ['type' => 'string', 'default' => '/contact'],
|
||||
@@ -1793,6 +1796,11 @@ function oribi_render_pricing_section($a, $content, $block)
|
||||
$cls = $a['variant'] === 'alt' ? 'section section-alt' : 'section';
|
||||
$count = count($block->inner_blocks);
|
||||
$has_label = !empty($a['label']);
|
||||
$toggle = '
|
||||
<div class="pricing-billing-toggle" role="group" aria-label="Billing period">
|
||||
<button class="pbt-option pbt-monthly active" data-billing="monthly" aria-pressed="true">Monthly</button>
|
||||
<button class="pbt-option pbt-annual" data-billing="annual" aria-pressed="false">Annual <span class="pbt-save-pill">Save 17%</span></button>
|
||||
</div>';
|
||||
ob_start();
|
||||
if ($has_label): ?>
|
||||
<section class="<?php echo esc_attr($cls); ?>">
|
||||
@@ -1803,6 +1811,7 @@ function oribi_render_pricing_section($a, $content, $block)
|
||||
<h2><?php echo wp_kses_post($a['heading']); ?></h2>
|
||||
<?php if ($a['lead']): ?><p class="lead"><?php echo wp_kses_post($a['lead']); ?></p><?php endif; ?>
|
||||
</div>
|
||||
<?php echo $toggle; ?>
|
||||
<div class="pricing-grid pricing-grid-<?php echo intval($count); ?>">
|
||||
<?php echo $content; ?>
|
||||
</div>
|
||||
@@ -1816,6 +1825,7 @@ function oribi_render_pricing_section($a, $content, $block)
|
||||
<h2><?php echo wp_kses_post($a['heading']); ?></h2>
|
||||
<?php if ($a['lead']): ?><p class="lead"><?php echo wp_kses_post($a['lead']); ?></p><?php endif; ?>
|
||||
</div>
|
||||
<?php echo $toggle; ?>
|
||||
<div class="pricing-grid pricing-grid-<?php echo intval($count); ?>">
|
||||
<?php echo $content; ?>
|
||||
</div>
|
||||
@@ -1849,6 +1859,13 @@ 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'] ?? '';
|
||||
|
||||
ob_start(); ?>
|
||||
<div class="pricing-card<?php echo $featured ? ' featured' : ''; ?>">
|
||||
<?php if ($featured && !empty($a['badge'])): ?>
|
||||
@@ -1863,11 +1880,15 @@ function oribi_render_pricing_card($a)
|
||||
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'])): ?>
|
||||
<?php if ($monthly_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 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_price); ?></div>
|
||||
<?php if ($annual_per): ?><div class="pricing-per pbt-show-annual" hidden><?php echo wp_kses_post($annual_per); ?></div><?php endif; ?>
|
||||
<?php if ($annual_savings): ?><div class="pricing-savings pbt-show-annual" hidden><?php echo esc_html($annual_savings); ?></div><?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user