Feedback; show panels at all times and redirect to store.

This commit is contained in:
Mike Jolley 2018-01-25 11:48:45 +00:00
parent 845c667e77
commit 9b155d53d4
1 changed files with 22 additions and 26 deletions

View File

@ -103,6 +103,22 @@ class WC_Shop_Customizer {
$( '.woocommerce-cropping-control' ).find( 'input:checked' ).change();
} );
wp.customize.section( 'woocommerce_product_catalog', function( section ) {
section.expanded.bind( function( isExpanded ) {
if ( isExpanded ) {
wp.customize.previewer.previewUrl.set( '<?php echo esc_js( wc_get_page_permalink( 'shop' ) ); ?>' );
}
} );
} );
wp.customize.section( 'woocommerce_product_images', function( section ) {
section.expanded.bind( function( isExpanded ) {
if ( isExpanded ) {
wp.customize.previewer.previewUrl.set( '<?php echo esc_js( wc_get_page_permalink( 'shop' ) ); ?>' );
}
} );
} );
wp.customize( 'woocommerce_catalog_columns', function( setting ) {
setting.bind( function( value ) {
var min = '<?php echo esc_js( $min_columns ); ?>';
@ -169,24 +185,6 @@ class WC_Shop_Customizer {
<?php
}
/**
* Should our settings show?
*
* @return boolean
*/
public function is_active() {
return is_woocommerce() || wc_post_content_has_shortcode( 'products' ) || ! current_theme_supports( 'woocommerce' );
}
/**
* Should our settings show on product archives?
*
* @return boolean
*/
public function is_products_archive() {
return is_shop() || is_product_taxonomy() || is_product_category() || ! current_theme_supports( 'woocommerce' );
}
/**
* Sanitize the shop page & category display setting.
*
@ -287,7 +285,6 @@ class WC_Shop_Customizer {
array(
'title' => __( 'Product Catalog', 'woocommerce' ),
'priority' => 10,
'active_callback' => array( $this, 'is_products_archive' ),
'panel' => 'woocommerce',
)
);
@ -444,7 +441,6 @@ class WC_Shop_Customizer {
array(
'title' => __( 'Product Images', 'woocommerce' ),
'priority' => 20,
'active_callback' => array( $this, 'is_active' ),
'panel' => 'woocommerce',
)
);