Skip to content

Commit

Permalink
hide controls when disable the section
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrafbd1496 committed Jan 24, 2022
1 parent 8f09d1c commit 195e186
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 15 deletions.
194 changes: 193 additions & 1 deletion inc/customizer/customizer-main.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
'type' => 'switch',
'settings' => 'banner_display_setting',
'label' => esc_html__( 'Display Banner Secton', 'simpleshop' ),
'description' => esc_html__( 'Display Banner control', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => 'on',
'choices' => [
Expand All @@ -49,6 +48,13 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'সততা। সহজতা। বিশ্বস্ততা।', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'banner_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Banner Section Link
Expand All @@ -59,6 +65,14 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'https://simpleshop.ashrafbd.com', 'simpleshop' ),
'priority' => 10,
'priority' => 10,
'active_callback'=>[
[
'setting'=>'banner_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Banner Section Link Text
Expand All @@ -69,6 +83,14 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'বই কিনুন', 'simpleshop' ),
'priority' => 10,
'priority' => 10,
'active_callback'=>[
[
'setting'=>'banner_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Product Category Section Show Hide
Expand All @@ -94,6 +116,13 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'Shop By Category', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'pcat_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Products Section Show Hide
Expand All @@ -119,6 +148,13 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'New Arrival', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'product_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Product Section Sub Ttile
Expand All @@ -129,8 +165,164 @@
'section' => 'simpleshop_homepage',
'default' => esc_html__( '37 New fashion products arrived recently in our showroom for this winter', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'product_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );


//Promo Section Show Hide
Kirki::add_field(SIMPLESHOP_CUSTOMIZER_CONFIG_ID,
[
'type' => 'switch',
'settings' => 'promo_display_setting',
'label' => esc_html__( 'Display Promo Secton', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => 'on',
'choices' => [
'on' => esc_html__( 'Enable', 'simpleshop' ),
'off' => esc_html__( 'Disable', 'simpleshop' ),
],
]
);

//Promo sectoion Ttile
Kirki::add_field( SIMPLESHOP_CUSTOMIZER_CONFIG_ID, [
'type' => 'text',
'settings' => 'promo_title_setting',
'label' => esc_html__( 'Promo Section Title', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'Up to 50% off', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'promo_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Promo Section Sub Ttile
Kirki::add_field( SIMPLESHOP_CUSTOMIZER_CONFIG_ID, [
'type' => 'link',
'settings' => 'promo_button_link_setting',
'label' => esc_html__( 'Promo Button Link', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'https://simplesop.ashrafbd.com', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'promo_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );
//Promo button link text
Kirki::add_field( SIMPLESHOP_CUSTOMIZER_CONFIG_ID, [
'type' => 'text',
'settings' => 'promo_link_text_setting',
'label' => esc_html__( 'Promo Button Link Text', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'in store and online', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'promo_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );


//Popular Products Section Show Hide
Kirki::add_field(SIMPLESHOP_CUSTOMIZER_CONFIG_ID,
[
'type' => 'switch',
'settings' => 'pproduct_display_setting',
'label' => esc_html__( 'Display Popular Product Secton', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => 'on',
'choices' => [
'on' => esc_html__( 'Enable', 'simpleshop' ),
'off' => esc_html__( 'Disable', 'simpleshop' ),
],
]
);

//Popular Products sectoion Ttile
Kirki::add_field( SIMPLESHOP_CUSTOMIZER_CONFIG_ID, [
'type' => 'text',
'settings' => 'pproduct_title_setting',
'label' => esc_html__( 'Popular Product Section Title', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'Up to 50% off', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'pproduct_display_setting',
'operator'=>'==',
'value'=>true,
]
],
] );

//Offer Section Show Hide
Kirki::add_field(SIMPLESHOP_CUSTOMIZER_CONFIG_ID,
[
'type' => 'switch',
'settings' => 'offer_display_setting',
'label' => esc_html__( 'Display Offer Secton', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => 'on',
'choices' => [
'on' => esc_html__( 'Enable', 'simpleshop' ),
'off' => esc_html__( 'Disable', 'simpleshop' ),
],
]
);

//Flickr Section Show Hide
Kirki::add_field(SIMPLESHOP_CUSTOMIZER_CONFIG_ID,
[
'type' => 'switch',
'settings' => 'flickr_display_setting',
'label' => esc_html__( 'Display Flickr Secton', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => 'on',
'choices' => [
'on' => esc_html__( 'Enable', 'simpleshop' ),
'off' => esc_html__( 'Disable', 'simpleshop' ),
],
]
);
//Flickr Section Title
Kirki::add_field(SIMPLESHOP_CUSTOMIZER_CONFIG_ID,
[
'type' => 'text',
'settings' => 'flickr_title',
'label' => esc_html__( 'Flickr Secton Title', 'simpleshop' ),
'section' => 'simpleshop_homepage',
'default' => esc_html__( 'SimpleShop on Flickr', 'simpleshop' ),
'priority' => 10,
'active_callback'=>[
[
'setting'=>'flickr_display_setting',
'operator'=>'==',
'value'=>true,
]
],
]
);






Expand Down
4 changes: 2 additions & 2 deletions template-parts/common/flickr.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'flickr_display_setting', 'on' ) ) : ?>
<!--flickr section start-->
<section class="">
<div class="container">
<div class="row justify-content-md-center">
<div class="col-md-8">
<div class="section-title text-center">
<h2 class="title ">SimpleShop on Flickr</h2>
<h2 class="title "><?php echo get_theme_mod('flickr_title') ?></h2>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion template-parts/common/offer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'offer_display_setting', 'on' ) ) : ?>
<!--offer section start-->
<section class="space-3 space-adjust">
<div class="container ">
Expand Down
4 changes: 2 additions & 2 deletions template-parts/homepage/popular-product.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'pproduct_display_setting', 'on' ) ) : ?>
<!--product section start-->
<section class="space-3">
<div class="container">
<div class="row justify-content-md-center">
<div class="col-md-8">
<div class="section-title text-center">
<h2 class="title ">Popular Product</h2>
<h2 class="title "><?php echo get_theme_mod('pproduct_title_setting'); ?></h2>
<!--<div class="sub-title">37 New fashion products arrived recently in our showroom for this-->
<!--winter-->
<!--</div>-->
Expand Down
4 changes: 2 additions & 2 deletions template-parts/homepage/product-category.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'pcat_display_setting', 'on' ) ) : ?>
<!--shop category start-->
<section class="space-3">
<div class="container sm-center">
<div class="row">
<div class="col-md-12">
<div class="section-title text-center">
<h2 class="title"> Shop By Category</h2>
<h2 class="title"><?php echo get_theme_mod('pcat_title_setting'); ?></h2>
</div>
</div>

Expand Down
6 changes: 2 additions & 4 deletions template-parts/homepage/products.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'product_display_setting', 'on' ) ) : ?>
<!--product section start-->
<section class="space-3 space-adjust">
<div class="container">
<div class="row justify-content-md-center">
<div class="col-md-8">
<div class="section-title text-center">
<h2 class="title ">New Arrival</h2>
<div class="sub-title">37 New fashion products arrived recently in our showroom for this
winter
<h2 class="title "><?php echo get_theme_mod('products_title_setting'); ?></h2><?php echo get_theme_mod('products_subtitle_setting'); ?>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions template-parts/homepage/promo.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php if ( true == get_theme_mod( 'banner_diplay_setting', 'on' ) ) : ?>
<?php if ( true == get_theme_mod( 'promo_display_setting', 'on' ) ) : ?>
<!--promo section start-->
<section>
<div class="container">
Expand All @@ -14,9 +14,9 @@
<h2 class="text-white mb-0 promo-title">
Sale
</h2>
<h3 class="text-white promo-sub-title mt-0">Up to 50% off</h3>
<h3 class="text-white promo-sub-title mt-0"><?php echo get_theme_mod('promo_title_setting'); ?></h3>

<a href="#" class="promo-link">in store and online</a>
<a href="<?php echo get_theme_mod('promo_button_link_setting'); ?>" class="promo-link"><?php echo get_theme_mod('promo_link_text_setting'); ?></a>
</div>
</div>
</div>
Expand Down

0 comments on commit 195e186

Please sign in to comment.