Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move default $show_top_submit_button and $show_bottom_submit_button values outside if statement #4445

Merged
merged 1 commit into from Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions includes/modules/pages/featured_products/header_php.php
Expand Up @@ -42,6 +42,8 @@
$show_submit = zen_run_normal();

$how_many = 0;
$show_top_submit_button = false;
$show_bottom_submit_button = false;

// check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed
if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) {
Expand Down Expand Up @@ -71,13 +73,9 @@

if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if ( (($how_many > 0 and $show_submit == true and $featured_products_split->number_of_rows > 0) and (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
}

Expand Down
6 changes: 2 additions & 4 deletions includes/modules/pages/products_all/header_php.php
Expand Up @@ -37,6 +37,8 @@
$show_submit = zen_run_normal();

$how_many = 0;
$show_top_submit_button = false;
$show_bottom_submit_button = false;

// check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed
if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) {
Expand Down Expand Up @@ -66,13 +68,9 @@

if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if ( (($how_many > 0 and $show_submit == true and $products_all_split->number_of_rows > 0) and (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
}
?>
6 changes: 2 additions & 4 deletions includes/modules/pages/products_new/header_php.php
Expand Up @@ -37,6 +37,8 @@
$show_submit = zen_run_normal();

$how_many = 0;
$show_top_submit_button = false;
$show_bottom_submit_button = false;

// check whether to use multiple-add-to-cart, and whether top or bottom buttons are displayed
if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == true and $products_new_split->number_of_rows > 0) {
Expand Down Expand Up @@ -66,13 +68,9 @@

if ( (($how_many > 0 and $show_submit == true and $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) {
$show_top_submit_button = true;
} else {
$show_top_submit_button = false;
}
if ( (($how_many > 0 and $show_submit == true and $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) {
$show_bottom_submit_button = true;
} else {
$show_bottom_submit_button = false;
}
}
?>