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

fix undefined array keys in category_page_renders function #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions trunk/lib/utils/widgets-rendering-logic.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,23 @@ function v3_render_bottom_line_widgets($v3_widgets_enables) {

// CATEGORY PAGE RENDER
function category_page_renders($settings): void {
$v3_widgets_enables = $settings['v3_widgets_enables'];
$v2_widgets_enables = $settings['v2_widgets_enables'];
if ($v3_widgets_enables['reviews_carousel_category']) {
add_action('woocommerce_after_shop_loop', 'wc_yotpo_show_reviews_carousel_widget', 10);
}
if ($v3_widgets_enables['promoted_products_category']) {
add_action('woocommerce_after_shop_loop', 'wc_yotpo_show_promoted_products_widget', 11);
}
if ($v3_widgets_enables['reviews_tab_category']) {
add_action('wp_footer', 'wc_yotpo_show_reviews_tab_widget', 12);
}
if (!use_v3_widgets() && $v2_widgets_enables['bottom_line_category']
|| (use_v3_widgets() && $v3_widgets_enables['star_rating_category'])
) {
add_action('woocommerce_after_shop_loop_item', 'wc_yotpo_show_buttomline', 7);
}
$v3_widgets_enables = isset($settings['v3_widgets_enables']) ? $settings['v3_widgets_enables'] : [];
$v2_widgets_enables = isset($settings['v2_widgets_enables']) ? $settings['v2_widgets_enables'] : [];

if (!empty($v3_widgets_enables['reviews_carousel_category'])) {
add_action('woocommerce_after_shop_loop', 'wc_yotpo_show_reviews_carousel_widget', 10);
}
if (!empty($v3_widgets_enables['promoted_products_category'])) {
add_action('woocommerce_after_shop_loop', 'wc_yotpo_show_promoted_products_widget', 11);
}
if (!empty($v3_widgets_enables['reviews_tab_category'])) {
add_action('wp_footer', 'wc_yotpo_show_reviews_tab_widget', 12);
}
if ((!use_v3_widgets() && !empty($v2_widgets_enables['bottom_line_category'])) ||
(use_v3_widgets() && !empty($v3_widgets_enables['star_rating_category']))
) {
add_action('woocommerce_after_shop_loop_item', 'wc_yotpo_show_buttomline', 7);
}
}

// REST OF PAGES RENDER
Expand Down