We’re locked at home because of covid-19, but working to support your business.
We apologize if you face any delay to get support response.
Stay safe and take care of your family and yourself.

Images dont load if i am not logged in

Hi, thanks in advanced for your help.

I developed a woocomerce site and used Additional Variation Images Gallery For WooCommerce plugin.

I noticed that if i am not logged in wordpress, images are not loading. Also noticed that variations dropdown is not showing when i am not logged in.

 

 

 

Hi, i have some more information. It seems that this happen because of some code I added to my functions.php in my child them. This code is to hide price and add to cart button until user is logged in.

This is my code:

function bbloomer_hide_price_add_cart_not_logged_in() {
if ( ! is_user_logged_in() ) {
remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 );
remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 );
remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 );
add_action( ‘woocommerce_single_product_summary’, ‘bbloomer_print_login_to_see’, 31 );
add_action( ‘woocommerce_after_shop_loop_item’, ‘bbloomer_print_login_to_see’, 11 );
}
}

function bbloomer_print_login_to_see() {
echo ‘<a href=”‘ . get_permalink(wc_get_page_id(‘myaccount’)) . ‘”>’ . __(‘Login to see prices’, ‘theme_name’) . ‘</a>’;
}

And this is the error wordpress sent to my as an automatic email:

E_ERROR en la línea 7 del archivo /home/c1880793/public_html/wp-content/plugins/woo-variation-gallery/includes/settings.php. Mensaje de error: Uncaught Error: Cannot use object of type Hide_Price as array in /home/c1880793/public_html/wp-content/plugins/woo-variation-gallery/includes/settings.php:7
Stack trace:
#0 /home/c1880793/public_html/wp-includes/class-wp-hook.php(287): woo_variation_gallery_settings(Object(Hide_Price))
#1 /home/c1880793/public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(Hide_Price), Array)
#2 /home/c1880793/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-settings.php(62): apply_filters(‘woocommerce_get…’, Array)
#3 /home/c1880793/public_html/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-menus.php(123): WC_Admin_Settings::get_settings_pages()
#4 /home/c1880793/public_html/wp-includes/class-wp-hook.php(287): WC_Admin_Menus->save_settings(”)
#5 /home/c1880793/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#6 /home/c1880793/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#7 /home/c1880793/public_html/wp-settings.

Question

How can i solve this. I neet to have price and add to cart button hiden until user loggs in.

Thanks in advanced!