- This topic has 8 replies, 3 voices, and was last updated 10 months, 3 weeks ago by
Artem Temos.
-
AuthorPosts
-
September 13, 2021 at 6:23 pm #16474
rrogersParticipantHi there ,
Placeholder on product grid not showing.
Maintenance page is not working at all.
Attachments:
You must be logged in to view attached files.September 14, 2021 at 8:45 am #16478
Artem TemosKeymasterHello,
When we test this on our development environment both features work correctly. Are you able to upload your website to hosting so we can check what is wrong?
Kind Regards
September 14, 2021 at 11:31 am #16479
BadChipParticipantI have same problems on Tethys theme by the way, the maintenance mode is not effective (Even after selecting a specific page), also placeholder images (configured in woocommerce settings) only apply to Single product page, not the shop page.
September 14, 2021 at 2:28 pm #16480
Artem TemosKeymasterTry to add the following code to the
functions.php
file in your child theme to fix the placeholder issueif ( ! function_exists( 'xts_custom_product_loop_thumbnail' ) ) { /** * Custom product loop thumbnail. */ function xts_custom_product_loop_thumbnail() { remove_filter( 'woocommerce_before_shop_loop_item_title', 'xts_product_loop_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'xts_output_product_loop_thumbnail', 10 ); } add_action( 'init', 'xts_custom_product_loop_thumbnail', 100 ); } if ( ! function_exists( 'xts_output_product_loop_thumbnail' ) ) { /** * Output product loop thumbnail. */ function xts_output_product_loop_thumbnail() { global $product; $attachment_ids = $product->get_gallery_image_ids(); $image_size = xts_get_loop_prop( 'product_image_size' ); $custom_image_size = xts_get_loop_prop( 'product_image_custom' ); $product_design = xts_get_loop_prop( 'product_design' ); ?> <div class="xts-product-image"> <?php if ( ! empty( get_post_thumbnail_id() ) ) : ?> <?php echo xts_get_image_html( // phpcs:ignore array( 'image_size' => $image_size, 'image_custom_dimension' => $custom_image_size, 'image' => array( 'id' => get_post_thumbnail_id(), ), ), 'image' ); ?> <?php else : ?> <?php echo wc_placeholder_img( $image_size ); // phpcs:ignore ?> <?php endif; ?> </div> <?php if ( isset( $attachment_ids[0] ) && $attachment_ids[0] && 'small' !== $product_design && 'small-bg' !== $product_design && 'mask' !== $product_design && xts_get_loop_prop( 'product_hover_image' ) ) : ?> <div class="xts-product-hover-image xts-fill"> <?php echo xts_get_image_html( // phpcs:ignore array( 'image_size' => $image_size, 'image_custom_dimension' => $custom_image_size, 'image' => array( 'id' => $attachment_ids[0], ), ), 'image' ); ?> </div> <?php endif; ?> <?php } }
Kind Regards
September 14, 2021 at 3:00 pm #16481
BadChipParticipantArtem THANKS! Tried the code and I can confirm it works. It’s weird this minor issue requires all that code.
1) Will this fix be included in next updates?
2) What about the Maintenance mode? It’s not effective what-so-ever for me.September 14, 2021 at 3:28 pm #16484
rrogersParticipantHi there,
Thank you for your reply.
The placeholder issue is fixed. I will do some more tests with the maintenance mode, I give feedback later.
I had to replace on page framework/integration/woocommerce/template-tags/loop-product.php<div class="xts-product-image"> <?php echo xts_get_image_html( // phpcs:ignore array( 'image_size' => $image_size, 'image_custom_dimension' => $custom_image_size, 'image' => array( 'id' => get_post_thumbnail_id(), ), ), 'image' ); ?> </div>
to:
<div class="xts-product-image"> <?php if ( ! empty( get_post_thumbnail_id() ) ) : ?> <?php echo xts_get_image_html( // phpcs:ignore array( 'image_size' => $image_size, 'image_custom_dimension' => $custom_image_size, 'image' => array( 'id' => get_post_thumbnail_id(), ), ), 'image' ); ?> <?php else : ?> <?php echo wc_placeholder_img( $image_size ); // phpcs:ignore ?> <?php endif; ?> </div>
September 15, 2021 at 8:31 am #16490
Artem TemosKeymasterTry to add the following code snippet to the functions.php file in the child theme to fix the maintenance mode
use XTS\Framework\Modules; if ( ! function_exists( 'xts_update_maintenance' ) ) { /** * Update maintenance. */ function xts_update_maintenance() { remove_action( 'template_redirect', array( Modules::get( 'maintenance' ), 'maintenance_redirect' ), 10 ); add_action( 'template_redirect', 'xts_update_maintenance_redirect', 11 ); } add_action( 'init', 'xts_update_maintenance', 11 ); } if ( ! function_exists( 'xts_update_maintenance_redirect' ) ) { /** * Redirect maintenance page. */ function xts_update_maintenance_redirect() { $maintenance_page = xts_get_opt( 'maintenance_page' ); if ( ! xts_get_opt( 'maintenance_mode' ) || ! $maintenance_page || is_user_logged_in() ) { return; } if ( ! is_page( $maintenance_page ) ) { wp_safe_redirect( get_permalink( $maintenance_page ) ); exit(); } } }
September 15, 2021 at 4:20 pm #16501
rrogersParticipantHi there,
Suggestion: Coming Soon mode (returning HTTP 200 code) or Maintenance Mode (returning HTTP 503 code) dropdown option.Maintenance mode works now. But I had to change on page:
#framework/modules/maintenance/class-maintenance.php line 45
` if ( is_page( $maintenance_page ) ) {
wp_safe_redirect( get_permalink( $maintenance_page ) );
exit();
}`to
` if ( ! is_page( $maintenance_page ) ) {
wp_safe_redirect( get_permalink( $maintenance_page ) );
exit();
}`Thank you !
September 16, 2021 at 6:08 am #16503
Artem TemosKeymasterYes, this fix will be included in our next theme update.
-
AuthorPosts
You must be logged in to reply to this topic.