Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ramonfincken/64874fae95a067102d2c1576f19bacb4 to your computer and use it in GitHub Desktop.
Save ramonfincken/64874fae95a067102d2c1576f19bacb4 to your computer and use it in GitHub Desktop.
Fix for
PHP Warning: Trying to access array offset on value of type null in /home/user/domains/domain.com/public_html/wp-content/plugins/woocommerce-thumbnail-input-quantities/woocommerce-thumbnail-input-quantity.php on line 107\n
OPEN
woocommerce-thumbnail-input-quantities/woocommerce-thumbnail-input-quantity.php
FIND
// Set the Minimum Quantity
if ( $this->incremental_active == false ) {
$min = 1;
} elseif ( $values['min_value'] != '' ) {
$min = $values['min_value'];
} elseif ( $values['min_value'] == '' and $values['step'] != '' ) {
$min = $values['step'];
} else {
$min = 1;
}
REPLACE WITH
// Set the Minimum Quantity
if ( $this->incremental_active == false ) {
$min = 1;
} elseif ( $values['min_value'] != '' ) {
$min = $values['min_value'];
} elseif ( $values['min_value'] == '' && isset( $values['step'] ) && $values['step'] != '' ) {
$min = $values['step'];
} else {
$min = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment