Skip to content

Commit c576b79

Browse files
authored
Merge pull request #293 from moderntribe/release/4.14.1
packaged version 4.14.1
2 parents 1c0fe81 + e59f035 commit c576b79

18 files changed

+66
-41
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
4+
## [4.14.1]
5+
6+
### Fixed
7+
- Fixed the product template include logic for WordPress 5.8
8+
- Fixed bug introduced in WordPress 5.8 that prevents WordPress Customizer from reacting when changes were made to the Product Catalog "Sort By" options.
9+
- Updates add to cart functionality to wait for creation of cart, so multiple add to carts function properly. Fix for: https://github.com/bigcommerce/bigcommerce-for-wordpress/issues/230
10+
311
## [4.14.0]
412

513
### Fixed
@@ -1454,6 +1462,7 @@
14541462
in fact, reset postdata, so far as Gutenberg 3.2.0 is concerned.
14551463

14561464

1465+
[4.14.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.14.0...4.14.1
14571466
[4.14.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.13.0...4.14.0
14581467
[4.13.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.12.0...4.13.0
14591468
[4.12.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/4.11.0...4.12.0

assets/js/dist/admin/scripts.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/admin/scripts.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/scripts.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/dist/scripts.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/src/admin/customizer/index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
import multiCheckboxes from './multiple-checkboxes';
77
import * as tools from '../../utils/tools';
88

9-
const el = {
10-
customizer: tools.getNodes('#customize-controls', false, document, true)[0],
11-
};
12-
139
const init = () => {
14-
if (!el.customizer) {
10+
/** Note: make sure to look for element after "DOM ready" */
11+
const customizer = tools.getNodes('#customize-controls', false, document, true)[0];
12+
13+
if (!customizer) {
1514
return;
1615
}
1716

18-
multiCheckboxes(el.customizer);
17+
multiCheckboxes(customizer);
1918

2019
console.info('BigCommerce: Initialized Theme Customizer Scripts.');
2120
};

assets/js/src/public/cart/add-to-cart.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ const createAjaxResponseMessage = (wrapper = '', message = '', error = false) =>
169169
*/
170170
const handleFetchingState = (button = '') => {
171171
if (!button) {
172+
const allCartButtons = tools.getNodes('.bc-btn--add_to_cart', true, document, true);
173+
allCartButtons.forEach(handleFetchingState);
172174
return;
173175
}
174176

@@ -228,12 +230,12 @@ const handleAjaxAddToCartRequest = (e) => {
228230
const url = cartID ? `${CART_API_BASE}/${cartID}` : CART_API_BASE;
229231
const query = getAjaxQueryString(cartButton);
230232

231-
handleFetchingState(cartButton);
233+
handleFetchingState(cartID ? cartButton : null);
232234
wpAPIAddToCartAjax(url, query)
233235
.set('X-WP-Nonce', AJAX_CART_NONCE)
234236
.end((err, res) => {
235237
state.isFetching = false;
236-
handleFetchingState(cartButton);
238+
handleFetchingState(cartID ? cartButton : null);
237239

238240
if (err) {
239241
console.error(err);

bigcommerce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: BigCommerce for WordPress
44
Description: Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
55
Author: BigCommerce
6-
Version: 4.14.0
6+
Version: 4.14.1
77
Author URI: https://www.bigcommerce.com/wordpress
88
Requires PHP: 7.2.0
99
Text Domain: bigcommerce

build-timestamp.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<?php
2-
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '6.02.07.02.2021');
2+
define('BIGCOMMERCE_ASSETS_BUILD_TIMESTAMP', '7.13.07.23.2021');

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: bigcommerce, moderntribe, jbrinley, becomevocal, vincentlistrani,
33
Tags: ecommerce, online store, sell online, storefront, retail, online shop, bigcommerce, big commerce, e-commerce, physical products, buy buttons, commerce, shopping cart, checkout, cart, shop, headless commerce, shipping, payments, fulfillment
44
Requires at least: 5.2
55
Tested up to: 5.5
6-
Stable tag: 4.14.0
6+
Stable tag: 4.14.1
77
Requires PHP: 7.2.0
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html

src/BigCommerce/Container/Editor.php

+6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ private function render_dialog_template( Container $container ) {
5050
echo $container[ self::UI_DIALOG ]->render_dialog_once();
5151
} );
5252
add_action( 'enqueue_block_editor_assets', $this->create_callback( 'block_editor_enqueue_dialog_template', function() use ( $container, $render_callback ) {
53+
$current_screen = get_current_screen();
54+
55+
if ( is_a( $current_screen, 'WP_Screen' ) && method_exists( $current_screen, 'is_block_editor' ) && ! $current_screen->is_block_editor() ) {
56+
return;
57+
}
58+
5359
if ( did_action( 'admin_enqueue_scripts' ) ) { // if the Gutenberg plugin is enabled, the action will already be called
5460
$render_callback();
5561
} else { // if using the Block Editor in WP core, no HTML has been rendered, so delay the output

src/BigCommerce/Container/Templates.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function register( Container $container ) {
8686

8787

8888
add_filter( 'template_include', $this->create_callback( 'template_include', function ( $path ) use ( $container ) {
89-
return $container[ self::OVERRIDE ]->fallback_to_plugin_template( $path );
89+
return $container[ self::OVERRIDE ]->include_product_template( $path );
9090
} ), 10, 1 );
9191

9292
add_filter( 'body_class', $this->create_callback( 'set_body_classes', function ( $classes ) use ( $container ) {

src/BigCommerce/Forms/Update_Profile_Handler.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ public function handle_request( $submission ) {
3939
$update_user = true;
4040
}
4141

42+
$userdata = $user->to_array();
4243
if ( $password ) {
43-
$user->user_pass = $password;
44+
$userdata['user_pass'] = $password;
4445
$update_user = true;
4546
$profile[ '_authentication' ][ 'password' ] = $password;
4647
}
4748

4849
if ( $update_user ) {
49-
$updated = wp_update_user( $user );
50+
$updated = wp_update_user( $userdata );
5051
if ( is_wp_error( $updated ) ) {
5152
switch ( $updated->get_error_code() ) {
5253
case 'existing_user_email':

src/BigCommerce/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace BigCommerce;
55

66
class Plugin {
7-
const VERSION = '4.14.0';
7+
const VERSION = '4.14.1';
88

99
protected static $_instance;
1010

src/BigCommerce/Templates/Template_Override.php

+17-9
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,7 @@ private function prefix_theme_paths( $paths ) {
173173
*
174174
* @filter template_include
175175
*/
176-
public function fallback_to_plugin_template( $template ) {
177-
if ( ! empty( $template ) ) {
178-
return $template;
179-
}
176+
public function include_product_template( $template ) {
180177
if ( is_singular( Product::NAME ) ) {
181178
return $this->get_product_single_path();
182179
}
@@ -194,29 +191,40 @@ public function fallback_to_plugin_template( $template ) {
194191
* @return bool|string Path to the product single template in the plugin
195192
*/
196193
private function get_product_single_path() {
197-
return $this->get_plugin_template_path( 'single-' . Product::NAME . '.php' );
194+
return $this->get_template_path( 'single-' . Product::NAME . '.php' );
198195
}
199196

200197
/**
201198
* @return bool|string Path to the product archive template in the plugin
202199
*/
203200
private function get_product_archive_path() {
204-
return $this->get_plugin_template_path( 'archive-' . Product::NAME . '.php' );
201+
return $this->get_template_path( 'archive-' . Product::NAME . '.php' );
205202
}
206203

207204
/**
208-
* Get the relative path to a template file in the plugin dir
205+
* Get the template path
209206
*
210207
* @param string $relative_path
211208
*
212209
* @return string|bool
213210
*/
214-
private function get_plugin_template_path( $relative_path ) {
211+
private function get_template_path( $relative_path ) {
212+
$path = '';
213+
/**
214+
* This filter is documented in src/BigCommerce/Templates/Controller.php
215+
*/
216+
$theme_dir = apply_filters( 'bigcommerce/template/directory/theme', '', $relative_path );
217+
if ( ! empty( $theme_dir ) ) {
218+
$path = locate_template( trailingslashit( $theme_dir ) . $relative_path );
219+
}
220+
215221
/**
216222
* This filter is documented in src/BigCommerce/Templates/Controller.php
217223
*/
218224
$plugin_dir = apply_filters( 'bigcommerce/template/directory/plugin', '', $relative_path );
219-
$path = trailingslashit( $plugin_dir ) . $relative_path;
225+
if ( empty( $path ) && ! empty( $plugin_dir ) ) {
226+
$path = trailingslashit( $plugin_dir ) . $relative_path;
227+
}
220228

221229
$path = apply_filters( 'bigcommerce/template/path', $path, $relative_path );
222230
if ( ! file_exists( $path ) ) {

vendor/autoload.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
require_once __DIR__ . '/composer/autoload_real.php';
66

7-
return ComposerAutoloaderInite5b4371c88b91e72e12444df1b09e8b5::getLoader();
7+
return ComposerAutoloaderInit1d7523f38cde5af43ae26f4a81856102::getLoader();

vendor/composer/autoload_real.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInite5b4371c88b91e72e12444df1b09e8b5
5+
class ComposerAutoloaderInit1d7523f38cde5af43ae26f4a81856102
66
{
77
private static $loader;
88

@@ -19,15 +19,15 @@ public static function getLoader()
1919
return self::$loader;
2020
}
2121

22-
spl_autoload_register(array('ComposerAutoloaderInite5b4371c88b91e72e12444df1b09e8b5', 'loadClassLoader'), true, true);
22+
spl_autoload_register(array('ComposerAutoloaderInit1d7523f38cde5af43ae26f4a81856102', 'loadClassLoader'), true, true);
2323
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24-
spl_autoload_unregister(array('ComposerAutoloaderInite5b4371c88b91e72e12444df1b09e8b5', 'loadClassLoader'));
24+
spl_autoload_unregister(array('ComposerAutoloaderInit1d7523f38cde5af43ae26f4a81856102', 'loadClassLoader'));
2525

2626
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
2727
if ($useStaticLoader) {
2828
require_once __DIR__ . '/autoload_static.php';
2929

30-
call_user_func(\Composer\Autoload\ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::getInitializer($loader));
30+
call_user_func(\Composer\Autoload\ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::getInitializer($loader));
3131
} else {
3232
$classMap = require __DIR__ . '/autoload_classmap.php';
3333
if ($classMap) {
@@ -39,19 +39,19 @@ public static function getLoader()
3939
$loader->register(true);
4040

4141
if ($useStaticLoader) {
42-
$includeFiles = Composer\Autoload\ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::$files;
42+
$includeFiles = Composer\Autoload\ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::$files;
4343
} else {
4444
$includeFiles = require __DIR__ . '/autoload_files.php';
4545
}
4646
foreach ($includeFiles as $fileIdentifier => $file) {
47-
composerRequiree5b4371c88b91e72e12444df1b09e8b5($fileIdentifier, $file);
47+
composerRequire1d7523f38cde5af43ae26f4a81856102($fileIdentifier, $file);
4848
}
4949

5050
return $loader;
5151
}
5252
}
5353

54-
function composerRequiree5b4371c88b91e72e12444df1b09e8b5($fileIdentifier, $file)
54+
function composerRequire1d7523f38cde5af43ae26f4a81856102($fileIdentifier, $file)
5555
{
5656
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
5757
require $file;

vendor/composer/autoload_static.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5
7+
class ComposerStaticInit1d7523f38cde5af43ae26f4a81856102
88
{
99
public static $files = array (
1010
'5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
@@ -1114,10 +1114,10 @@ class ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5
11141114
public static function getInitializer(ClassLoader $loader)
11151115
{
11161116
return \Closure::bind(function () use ($loader) {
1117-
$loader->prefixLengthsPsr4 = ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::$prefixLengthsPsr4;
1118-
$loader->prefixDirsPsr4 = ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::$prefixDirsPsr4;
1119-
$loader->prefixesPsr0 = ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::$prefixesPsr0;
1120-
$loader->classMap = ComposerStaticInite5b4371c88b91e72e12444df1b09e8b5::$classMap;
1117+
$loader->prefixLengthsPsr4 = ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::$prefixLengthsPsr4;
1118+
$loader->prefixDirsPsr4 = ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::$prefixDirsPsr4;
1119+
$loader->prefixesPsr0 = ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::$prefixesPsr0;
1120+
$loader->classMap = ComposerStaticInit1d7523f38cde5af43ae26f4a81856102::$classMap;
11211121

11221122
}, null, ClassLoader::class);
11231123
}

0 commit comments

Comments
 (0)