price table shortcode with visual composer
price table shortcode:-
===================================================================================
//html code:-
<div class="row">
<div class="pricing-table">
<div class="pricing-head"><i class="icon-lock"></i>
<h4 class="upper">Starter</h4>
</div>
<div class="price">
<h2><span>$</span>10<span>/m</span></h2>
</div>
<ul class="features nav">
<li><span>512MB</span> Memory</li>
<li><span>1 Core</span> Processor</li>
<li><span>20GB</span> SSD Disk</li>
<li><span>1TB</span> Transfer</li>
</ul>
<div class="pricing-footer"><a href="#" class="btn btn-color">Order Now</a></div>
</div>
</div>
..............................
<?php
function commet_price($one, $two){
$commet = shortcode_atts([
'p-featured' =>' ',
'p-icon' =>' ',
'p-name' =>' ',
'p-currency' =>' ',
'p-amount' =>' ',
'p-dura' =>' ',
'p-feature-list' =>' ',
'feature_name' =>' ',
'p-b-text' =>' ',
'p-bt-color' =>' ',
'p-b-color' =>' ',
'p-b-link' =>' ',
], $one);
ob_start();
?>
<div class="row">
<div class="pricing-table <?php echo $commet['p-featured']; ?> ">
<div class="pricing-head"><i class="<?php echo $commet['p-icon']; ?>"></i>
<h4 class="upper"><?php echo $commet['p-name']; ?></h4>
</div>
<div class="price">
<h2><span><?php echo $commet['p-currency']; ?></span><?php echo $commet['p-amount']; ?><span>/<?php echo $commet['p-dura']; ?></span></h2>
</div>
<ul class="features nav">
<?php
$list = vc_param_group_parse_atts($commet['p-feature-list']);
foreach($list as $lillll) :
?>
<li><?php echo $lillll['feature_name']; ?></li>
<?php endforeach; ?>
</ul>
<div class="pricing-footer">
<a href="<?php echo $commet['p-b-link']; ?>" style="background-color: <?php echo $commet['p-b-color']; ?>; color:<?php echo $commet['p-bt-color']; ?>;" class="btn"><?php echo $commet['p-b-text']; ?></a>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
add_shortcode('commet_price', 'commet_price');
vc_map([
'name' =>'Commet Price Table',
'base' =>'commet_price',
'icon' =>get_template_directory_uri(). '/images/cat.png',
'description' =>'Commet Custom box',
'params' =>[
[
'param_name' => 'p-featured',
'type' =>'dropdown',
'heading' =>'Featured',
'value' =>[
'Select' =>' ',
'Yes' =>'featured',
'No' =>'no'
]
],
[
'param_name' => 'p-icon',
'type' =>'iconpicker',
'heading' =>'Icon',
'description' =>'Commet Icon',
],
[
'param_name' => 'p-name',
'type' =>'textfield',
'heading' =>'Package Name',
'description' =>'Commet Package',
],
[
'param_name' => 'p-currency',
'type' =>'textfield',
'heading' =>'Currency',
'description' =>'Commet Currency',
],
[
'param_name' => 'p-amount',
'type' =>'textfield',
'heading' =>'Amount',
'description' =>'Commet amount',
],
[
'param_name' => 'p-dura',
'type' =>'textfield',
'heading' =>'Duration',
'description' =>'Commet Duration',
],
[
'param_name' => 'p-feature-list',
'type' =>'param_group',
'heading' =>'Add Feature List',
'description' =>'Commet Feature',
'params' =>[
[
'param_name' =>'feature_name',
'type' =>'textfield',
'heading' =>'Add Feature'
]
]
],
[
'param_name' => 'p-b-text',
'type' =>'textfield',
'heading' =>'Button Text',
'description' =>'Commet Button',
],
[
'param_name' => 'p-bt-color',
'type' =>'colorpicker',
'heading' =>'Button Text Color',
'description' =>'Commet Text Button Color',
],
[
'param_name' => 'p-b-color',
'type' =>'colorpicker',
'heading' =>'Button Color',
'description' =>'Commet Button Color',
],
[
'param_name' => 'p-b-link',
'type' =>'textfield',
'heading' =>'Button Link',
'description' =>'Commet Button Link',
],
],
]);
?>
...........................................
No comments