Skip to content

Commit 687675b

Browse files
Merge pull request #96 from bigboxwc/release/2.1.0
release/2.1.0
2 parents ba9d094 + e37d9b1 commit 687675b

31 files changed

+273
-217
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [2.1.0] - 2018-12-18
2+
3+
### New
4+
5+
- WordPress 5.x compatibility.
6+
- Gutenberg 4.x compatibility.
7+
- WooCommerce 3.5.x compatibility.
8+
9+
### Fix
10+
11+
- Ensure button color is accurately reflected.
12+
- Coding standad updates.
13+
114
## [2.0.0] - 2018-11-06
215

316
### Breaking

app/customize/output/color-gray-300.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
// Solid border-color.
3232
[
3333
'selectors' => [
34+
'hr',
3435
'table',
3536
'table tr',
3637
'thead',

app/customize/output/color-gray-400.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
// Solid border-color.
2020
[
2121
'selectors' => [
22+
'textarea:focus',
23+
'[type="email"]:focus',
24+
'[type="search"]:focus',
25+
'[type="tel"]:focus',
26+
'[type="url"]:focus',
27+
'[type="password"]:focus',
28+
'[type="text"]:focus',
2229
'.wc_payment_method [type="radio"] label:before',
2330
'ul.brands_index li a',
2431
'ul.brands_index li span',

app/customize/output/color-gray-600.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@
4242
// @mixin button--pill.
4343
[
4444
'selectors' => [
45+
'.button--pill',
4546
'.product__has-variations .button.button--pill',
4647
'.widget_layered_nav_filters .button.button--pill',
4748
'.woocommerce-grouped-product-list-item__quantity .button',
4849
],
4950
'declarations' => [
50-
'color' => esc_attr( $gray600 ),
51-
'background-color' => esc_attr( bigbox_get_theme_color( 'gray-100' ) ),
52-
'border-color' => esc_attr( bigbox_get_theme_color( 'gray-300' ) ),
51+
'color' => esc_attr( $gray600 ) . ' !important',
52+
'background-color' => esc_attr( bigbox_get_theme_color( 'gray-100' ) ) . ' !important',
53+
'border-color' => esc_attr( bigbox_get_theme_color( 'gray-300' ) ) . ' !important',
5354
],
5455
],
5556
];

app/customize/selector-functions.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ function( $selector ) use ( $state ) {
4040
*/
4141
function bigbox_customize_get_button_selectors() {
4242
return [
43-
'.button:not(.button--text)',
44-
'button:not(.button--text)',
43+
'.button',
44+
'button',
4545
'.widget_layered_nav_filters a',
4646
'.woocommerce-notice-list__item .woocommerce-Button',
4747
'.woocommerce-notice-list__item .wc-forward',
48-
'.single_add_to_cart_button',
4948
'.woocommerce-Address-title .edit',
5049
'.widget_shopping_cart_content .checkout',
5150
'#wl-wrapper.wl-button-wrap .wl-add-to-single',
@@ -69,8 +68,8 @@ function bigbox_customize_get_button_success_selectors() {
6968
'.checkout-button',
7069
'#place_order',
7170
'.single_add_to_cart_button',
71+
'.woocommerce-Button.button',
7272
'.woocommerce-form-coupon [name="apply_coupon"]',
73-
'.woocommerce-notice-list__item .woocommerce-Button',
7473
'.woocommerce-notice-list__item .wc-forward',
7574
];
7675
}

app/integrations/woocommerce-brands/template-functions.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ function bigbox_woocommerce_single_brand_thumbnail() {
2222
// @codingStandardsIgnoreStart
2323
global $WC_Brands;
2424

25-
echo '<div class="woocommerce-product-brand">';
25+
$brand_atts = [
26+
'post_id' => wc_get_product()->get_id(),
27+
'height' => '50px',
28+
];
2629

27-
echo $WC_Brands->output_product_brand(
28-
/**
29-
* Filters the arguments used to output a brand logo.
30-
*
31-
* @since 1.0.0
32-
*
33-
* @param array $atts Attributes used to output the brand logo.
34-
*/
35-
apply_filters(
36-
'bigbox_woocommerce_product_brand_atts', [
37-
'post_id' => wc_get_product()->get_id(),
38-
'height' => '50px',
39-
]
40-
)
41-
);
30+
/**
31+
* Filters the arguments used to output a brand logo.
32+
*
33+
* @since 1.0.0
34+
*
35+
* @param array $atts Attributes used to output the brand logo.
36+
*/
37+
$brand_atts = apply_filters( 'bigbox_woocommerce_product_brand_atts', $brand_atts );
4238

39+
echo '<div class="woocommerce-product-brand">';
40+
echo $WC_Brands->output_product_brand( $brand_atts );
4341
echo '</div>';
4442
// @codingStandardsIgnoreEnd
4543
}

app/integrations/woocommerce/account.php

Lines changed: 0 additions & 14 deletions
This file was deleted.

app/integrations/woocommerce/class-woocommerce.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public function register() {
5050
include_once $this->get_dir() . '/starter-content.php';
5151
include_once $this->get_dir() . '/cart.php';
5252
include_once $this->get_dir() . '/checkout.php';
53-
include_once $this->get_dir() . '/account.php';
5453
include_once $this->get_dir() . '/widgets.php';
5554
include_once $this->get_dir() . '/emails.php';
5655
include_once $this->get_dir() . '/nav-menus.php';
@@ -71,26 +70,27 @@ public function add_theme_support() {
7170
add_theme_support( 'wc-product-gallery-lightbox' );
7271
add_theme_support( 'wc-product-gallery-slider' );
7372

73+
$wc_theme_support = [
74+
'gallery_thumbnail_image_width' => 150,
75+
'product_grid' => [
76+
'default_columns' => 5,
77+
'min_columns' => 1,
78+
'max_columns' => 6,
79+
],
80+
];
81+
82+
/**
83+
* Filters WooCommerce theme support arguments.
84+
*
85+
* @since 1.0.0
86+
*
87+
* @param array $support The theme's specific settings.
88+
*/
89+
$wc_theme_support = apply_filters( 'bigbox_woocommerce_theme_support', $wc_theme_support );
90+
7491
add_theme_support(
7592
'woocommerce',
76-
/**
77-
* Filters WooCommerce theme support arguments.
78-
*
79-
* @since 1.0.0
80-
*
81-
* @param array $support The theme's specific settings.
82-
*/
83-
apply_filters(
84-
'bigbox_woocommerce_theme_support',
85-
[
86-
'gallery_thumbnail_image_width' => 150,
87-
'product_grid' => [
88-
'default_columns' => 5,
89-
'min_columns' => 1,
90-
'max_columns' => 6,
91-
],
92-
]
93-
)
93+
$wc_theme_support
9494
);
9595
}
9696
}

app/integrations/woocommerce/page-templates.php

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,16 @@ function bigbox_woocommerce_assign_page_templates( $templates ) {
6464
* @return string
6565
*/
6666
function bigbox_woocommerce_dynamic_shop_page_template() {
67+
$path = bigbox_woocommerce_template_path() . 'archive-product-page.php';
68+
6769
/**
6870
* Filters the name (path) of the template name used for dynamic shop pages.
6971
*
7072
* @since 1.0.0
7173
*
7274
* @param string $name The name (including path from theme root) of the template file.
7375
*/
74-
return apply_filters(
75-
'bigbox_woocommerce_dynamic_shop_page_template',
76-
bigbox_woocommerce_template_path() . 'archive-product-page.php'
77-
);
76+
return apply_filters( 'bigbox_woocommerce_dynamic_shop_page_template', $path );
7877
}
7978

8079
/**
@@ -169,20 +168,17 @@ function bigbox_woocommerce_dynamic_shop_pages_create_sidebars() {
169168
'after_title' => '</h3>',
170169
];
171170

172-
register_sidebar(
173-
/**
174-
* Filters the argument used when registering sidebars for dynamic shop pages.
175-
*
176-
* @since 1.0.0
177-
*
178-
* @param array $args The arguments used in register_sidebar()
179-
*/
180-
apply_filters(
181-
'bigbox_woocommerce_dynamic_shop_pages_widget_args',
182-
$woocommerce_dynamic_shop_page_widget_args,
183-
$page
184-
)
185-
);
171+
/**
172+
* Filters the argument used when registering sidebars for dynamic shop pages.
173+
*
174+
* @since 1.0.0
175+
*
176+
* @param array $args The arguments used in register_sidebar()
177+
* @param int $page The current page ID.
178+
*/
179+
$sidebar = apply_filters( 'bigbox_woocommerce_dynamic_shop_pages_widget_args', $woocommerce_dynamic_shop_page_widget_args, $page );
180+
181+
register_sidebar( $sidebar );
186182
}
187183
}
188184
add_action( 'widgets_init', 'bigbox_woocommerce_dynamic_shop_pages_create_sidebars' );

app/integrations/woocommerce/template-functions.php

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,19 @@ function bigbox_woocommerce_widget_cart_is_hidden( $hidden ) {
9191
* @return array
9292
*/
9393
function bigbox_woocommerce_js_settings( $settings ) {
94+
/**
95+
* Filters the maximum number of products that can be added at one time.
96+
*
97+
* @since 1.0.0
98+
*
99+
* @param int $max The maximum number that can be used at one time.
100+
*/
101+
$global_max = apply_filters( 'bigbox_woocommerce_quantity_selector_max', 30 );
102+
94103
$settings['woocommerce']['products'] = [
95104
'quantitySelector' => [
96105
'zero' => trim( 0 . ' ' . ( ! is_singular( 'product' ) ? esc_html__( '(remove)', 'bigbox' ) : null ) ),
97-
/**
98-
* Filters the maximum number of products that can be added at one time.
99-
*
100-
* @since 1.0.0
101-
*
102-
* @param int $max The maximum number that can be used at one time.
103-
*/
104-
'globalMax' => apply_filters(
105-
'bigbox_woocommerce_quantity_selector_max',
106-
30
107-
),
106+
'globalMax' => $global_max,
108107
],
109108
];
110109

@@ -124,20 +123,19 @@ function bigbox_woocommerce_js_settings( $settings ) {
124123
* @return bool
125124
*/
126125
function bigbox_is_shop() {
126+
$is_shop = (
127+
( is_shop() || is_product_taxonomy() )
128+
|| is_page_template( bigbox_woocommerce_dynamic_shop_page_template() )
129+
);
130+
127131
/**
128132
* Filters a conditional to determine if the current page is a shop.
129133
*
130134
* @since 1.0.0
131135
*
132136
* @param bool $is_shop If the current page should be considered a shop.
133137
*/
134-
return apply_filters(
135-
'bigbox_is_shop',
136-
(
137-
( is_shop() || is_product_taxonomy() )
138-
|| is_page_template( bigbox_woocommerce_dynamic_shop_page_template() )
139-
)
140-
);
138+
return apply_filters( 'bigbox_is_shop', $is_shop );
141139
}
142140

143141
/**
@@ -263,27 +261,29 @@ function bigbox_woocommerce_after_output_product_categories( $output ) {
263261
<?php endif; ?>
264262

265263
<?php
266-
/**
267-
* Filters if the product categories dropdown should be shown.
268-
*
269-
* @since 1.0.0
270-
*
271-
* @param bool $show Should the dropdown show?
272-
*/
273-
if ( ! empty( $more_categories ) && apply_filters( 'bigbox_woocommerce_after_output_product_categories_dropdown', true ) ) :
264+
/**
265+
* Filters if the product categories dropdown should be shown.
266+
*
267+
* @since 1.0.0
268+
*
269+
* @param bool $show Should the dropdown show?
270+
*/
271+
$categories_dropdown = apply_filters( 'bigbox_woocommerce_after_output_product_categories_dropdown', true );
272+
273+
if ( ! empty( $more_categories ) && $categories_dropdown ) :
274274
?>
275-
<form id="product-category-selector" action="<?php echo esc_url( wc_get_page_permalink( 'shop' ) ); ?>" method="GET" class="product-category-more__selector">
276-
<select name="product_cat">
277-
<option><?php echo esc_html_e( 'More...', 'bigbox' ); ?></option>
275+
<form id="product-category-selector" action="<?php echo esc_url( wc_get_page_permalink( 'shop' ) ); ?>" method="GET" class="product-category-more__selector">
276+
<select name="product_cat">
277+
<option><?php echo esc_html_e( 'More...', 'bigbox' ); ?></option>
278278

279279
<?php foreach ( $more_categories as $category ) : ?>
280-
<option value="<?php echo esc_url( get_term_link( $category ) ); ?>"><?php echo esc_html( $category->name ); ?></option>
281-
<?php endforeach; ?>
282-
</select>
283-
</form>
284-
<?php endif; ?>
285-
</div>
286-
</li>
280+
<option value="<?php echo esc_url( get_term_link( $category ) ); ?>"><?php echo esc_html( $category->name ); ?></option>
281+
<?php endforeach; ?>
282+
</select>
283+
</form>
284+
<?php endif; ?>
285+
</div>
286+
</li>
287287

288288
<?php
289289
}
@@ -326,10 +326,12 @@ function bigbox_woocommerce_template_loop_variations() {
326326
if ( 'variable' !== $product->get_type() ) {
327327
return;
328328
}
329+
330+
$link = apply_filters( 'woocommerce_loop_product_link', $product->get_permalink(), $product );
329331
?>
330332

331333
<div class="product__has-variations product__meta">
332-
<a href="<?php echo esc_url( apply_filters( 'woocommerce_loop_product_link', $product->get_permalink(), $product ) ); ?>" class="button button--pill">
334+
<a href="<?php echo esc_url( $link ); ?>" class="button button--pill">
333335
<?php esc_html_e( 'See More Options', 'bigbox' ); ?>
334336
</a>
335337
</div>

0 commit comments

Comments
 (0)